How is a submarine able to move on as well as go under water?

How is a submarine able to move on as well as go under water?

Answer:
To move a submarine under water, water is admitted in its special tank, which causes a net increase in weight due to which the submarine goes down in water.
In the same manner, to bring the submarine up on the surface of the sea, the water from the tanks is ejected out by compressed air, due to which the net weight of the submarine decreases and it comes up on the surface of the water.