If you’re floating on your back as a way to learn how to swim, then you should take extra caution and be with your spotter at all times.
The spotter will place his hand under your back and will let you make the necessary adjustments to your body until you’re comfortable trying the technique on your own. [2] X Research source
Once your body is aligned with the surface of the water and your back is relatively parallel to the water, it’ll be much easier to make adjustments to the rest of your body.
If you’re more comfortable in the water, you can move your arms straight behind your head, mimicking the diving position, which will change your center of buoyancy and will balance out the weight of your legs more. You can also move your arms straight out or even keep them just a few inches away from your sides. Whatever you do with your arms, make sure that your palms are always facing the ceiling or sky.
If you get out of floating position, just align your body with the surface of the water and try again. Learning to float on your back takes time.