Having a strong core and quads/hamstring muscles will also help, so you’ll be able to stay on position without tiring and dropping your hands to stay balanced!
Lots of trotting, grid work and practicing jumping position while just on the flat will help!
It’s all in the heels. Your center of balance is mostly in your heels, so when you have them down it increases your balance. It also helps to do a lot of two point work while warming up and flatting.