A player will swim automatically when entering a water tile deep enough. When swimming, stamina is lost (if moving) and drowning will occur when stamina is depleted.
Some animals can also swim.
Can't get out of the water? Are you going to die? Try using Last Gasp.