A submarine sinks by taking water into its buoyancy tanks. Once submerged, the upthrust is unchanged, but the weight of the submarine increases with the inflow of water and it sinks faster. Compressed air is used to blow water out of the tanks when it has to resurface.
(An atomic submarine. This remains underwater for weeks without surfacing).