The world record for holding your breath is 24 minutes and 3.45 seconds, set by Aleix Segura Vendrell of Spain in February 2016. These records are ratified by the International Association for the Development of Apnea, which specializes in free diving. These athletes pre-breathe pure oxygen before submerging themselves, which allows them to hold their breath for much longer than the average person.
The human body is actually quite adapted to breathing underwater: The heart rate and metabolism slow down to conserve oxygen, and the body can actually survive for twice as long in water as on land. However, it's very important to not hyperventilate when you're trying to extend your breath-hold, as this could lead to a sudden loss of consciousness, inhaling water and drowning. This is why many water-based recreation areas are cracking down on breath-holding contests, which a recent study revealed can be dangerous for even trained professionals.
Training yourself to hold your breath longer is a process that requires patience and dedication. Try focusing on something that's relaxing to you and remember to stay as still as possible. Movement will consume precious oxygen that your body needs to stay alive, so it's important to practice sitting up rather than lying down. It's also a good idea to practice exhaling slowly so that the oxygen in your lungs can move around more quickly and get to where it needs to go.
Actor Kate Winslet, who starred in the movie Avatar: The Way of Water, was able to hold her breath for seven minutes and 15 seconds on set. She credits a lot of her success to the hard work she put in beforehand. She reportedly did all her own underwater breathing training and learned to breathe from the diaphragm, which helps to keep your lungs as full as possible while you're underwater.