By controlling the amount of water we pour into the can, we can control the rate and depth of its dive under the water's surface. Submarines have an inner and an outer steel shell, called a hull. The area in between the two hulls is called the ballast tank. It can be filled with either air or water. When the submarine is on the surface, the ballast tanks are filled with air and the submarine's overall density is less than that of the surrounding water.
Ballast tanks are open at the bottom.
To dive, the submarine operator opens up valves at the top and lets air out. It's something like blowing bubbles when you are swimming underwater. Seawater rushes in to fill the space that was taken up by air. This changes the ship's density. When the density of the submarine is greater than the surrounding water, it begins to sink.