Like many other fish, sharks breathe using their gills. Sharks have 5 to 7 gills on each side, just behind their eyes and above their fins. As you might know, humans have two lungs on their chest which takes care of respiration. Gills act similarly to Lungs; except for the fact that sharks absorb the oxygen (O) they need from water (H2O) while humans absorb the needed oxygen (O) through the air (O2).
As the sharks are swimming along, the water (H2O) enters their mouth. Just like the nose of a human, the gills of a shark are holes and water can go through them. So the water which has entered the shark’s body goes through the gills, the gills absorb the oxygen (O), and then the rest of the water goes out through the gills and back into the sea.
This is why some sharks are at all times swimming. They swim all the time to allow water to enter their mouth and oxygen to be absorbed. If they don’t swim and keep the flow of the water, they will suffocate.