What are submarines?
There is no question that ships and boats float in water. As long as the air in a ship's hold is lighter than the water the ship displaces, it will not sink. If you were to drill a hole in the hull, the inflowing water would make the ship heavier and it would sink.
In contrast, submarines are designed to sink, but must be able to resurface as well. How can a boat not only move forward and backward, but also up and down? That feature is made possible by the ability of the boat to make itself light or heavy. Here is how that works: the container in which the submarine pilot sits is not large. It is called a pressure hull for submarines, because it pushes away the weight of the water. The boat has tanks attached to it. As long as they contain air, the boat will float. When the submarine pilot pumps water into the tanks and lets out the air, the submarine will slowly sink.
How does the submarine come back up? The tanks need to be filled with air or another gas to squeeze the water back out. Think of the balloons you know from parties or fairgrounds. They contain helium, a gas that is even lighter than air and makes the balloons rise up. After a few days, the helium escapes and the balloon is back on the ground.
What is water pressure? Water pressure is the weight of water. The deeper you dive, the more water is above your body, which means that pressure increases. Because our lungs are always full of air, they would be compressed more and more. That means we need a strong protective armor to take deep dives, and that is the purpose of the pressure hull.
Imagine you are going over the deepest place in the ocean with a boat. It is deeper than the highest mountain. Now imagine you were to throw in a soda can, which would have to be closed. It would sink and sink until it reached the bottom of the sea. It may be a bit dented, but it would stay intact, because the water cannot compress the soda in the can. Now let's take a soda can that is closed but contains air. We would have to tie a heavy stone to it to make it sink at all. This can would also sink and sink, but when it reached the bottom, it would be completely crushed, if it didn't burst. The air would be compressed into a tiny bubble.
You can try this on your own. Take a full water syringe and push your finger hard on the opening. Then try to push down the plunger. It can't be done. Now squeeze out the water, put your finger on the hole and try the experiment when the syringe is full of air. You will notice that you can push the plunger in to some extent, depending on how hard you push and how strong you are.