Stamina is a limited supply of running power. It is displayed as a bar on top of the HUD.
When a Player is running their stamina will deplete. Standing still or walking will regenerate stamina. Stamina will deplete faster the more encumbered the player is. If the player is encumbered , stamina will be depleted at significantly higher rate. If overencumbered , just walking may even slowly deplete it. Running on roads depletes stamina slower than cross country running, but increases risk of getting run over.
When overencumbered the stamina bar turn red under 20% and the player will collapse for a moment until their stamina regenerates enough. It is better to stop running and regenerate it, than collapsing. Collapsing never happens if you're not overencumbered.
Sprinting while low on stamina is slower than when stamina is full.
Vaulting an obstacle doesn't consume any stamina.
When swimming, any movement depletes your stamina. Standing still doesn't consume stamina but doesn't regenerate it either. If your stamina bar gets below ~12% you will drown. You can "sprint" while swimming. The more encumbered you are the slower you swim but a full stamina bar will always give you exactly 15.8s of swimming time, even if you sprint while overencumbered.
Therefore to maximize your total swimming distance you should always sprint while swimming and try to have as little encumbrance as possible. If you accidentally fall in water and fear you won't be able to swim to safety, your best chance is to drop all your gear and sprint-swim without unnecessary movements.