Put the numbers in order.
21,21,23,25,31,39
Since there are 6 numbers, there is technically 2 middle numbers. When this happens, you go to the number between those 2 numbers. The middle 2 numbers are 23 and 25 therefore the median would be 24. I hope that helps. :)