To solve this type of problem we order the data from lowest to highest and compute the median, that number will be the one in the center of the magic square, also we group the numbers as follows:
first and last,
first+1 and last-1,
and so on.
The grouped numbers will be on opposite sides of the square with respect to the center.
In this case, the median is 4, and the grouped numbers are 0 and 8, 1 and 7, 2 and 6, 3 and 5.
Answer: