“Swimming” isn’t necessarily always the answer.
If you happen to find yourself in the water without a flotation device/life jacket then the best way of floating while in rough, open water is the survival float or the face down float. This style of floating allows you to conserve your energy so you can stay in the water for longer. Variations for individual buoyancy can be accomplished by adjusting the legs by drawing them up toward the chest or extending them out and adjusting the arms by extending them or drawing them in towards the chest. These actions balance the floater around the chest, the center of buoyancy.
In calmer waters lying on your back or back floating is best.
Read more: here