How do you get a submarine to rise from the bottom of the ocean to the surface again? Do you press a button? Flip a switch? Use a lever? How do you initiate the surfacing process?
Interesting question but more an engineering one. The basic physics is that a submarine modifies its buoyancy by filling various chambers (dedicated for this purpose) with water or pumping the water out and filling the chambers with air. Understanding buoyancy is important: basically, if something weighs less than the water it displaces, it floats; if something weighs more than the water it displaces, it sinks.
As more water is allowed to enter the submarine's chambers through the opening of valves, the submarine becomes heavier (or another way to look at it is, the submarine is decreasing its displacement of water by allowing the water to fill its volume) and therefore its buoyancy decreases and it can be caused to sink. When air is pumped into the chambers and water is pumped and then sealed out of the vessel, the submarine becomes lighter and has a larger displacement, so its buoyancy increases and it rises toward the surface.
Pressure differentials play a big role in all this. Getting water back into the chambers, getting water out of the chambers and filling them with air, maintaining healthy pressure for the submarine's compartments that house humans - all this involves careful calculation of pressures in different parts of the system and how we can manage and change those pressures to get the submarine to function as desired.