Elementary science, my friend.
Cold water is heavier, so it sinks to the bottom.
The hot water rises to the top, which is also where you’ll find the outflow pipe, the one that goes to your hot water faucet.
As a result, you’ll always be getting the hottest water in the heater.
Most water heaters are large enough that the water in it has enough time to heat up before it flows to your tap or shower head. Even in large families with more than one bathroom, cold water coming out of the hot water tap is rarely a problem.
If it is, your water heater is most likely old and dinky and it’s time to get a new one.