Our bodies do use the oxygen as it's absorbed in our bloodstream to run our bodies, so it must be replaced in the atmosphere so we can stay alive. For this, each submarine has a huge amount of oxygen tanks on board. If it stops in ports during its patrol, the oxygen tanks are replenished but the type of submarine I was on, with all the nuclear weapons on board, rarely stopped anywhere so we had to use an Oxygen Generator to refill the tanks. Not to get too scientific, it takes sea water (H2O), strips the salt out and then zaps the water with electricity to the point where it separates the hydrogen and oxygen and places them in two separate tanks. This piece of equipment had a nickname and it was called: “The Bomb,” because if the operator put too much of either of these gases into a tank, the submarine would explode.
Next, the hydrogen was constantly being released outside the submarine in microbubbles so that no one could detect where the sub was while the oxygen was piped to the oxygen tanks. Oxygen lines went throughout the submarine so that it was constantly being pumped into the atmosphere.
Lastly, too much carbon dioxide is dangerous and when we exhale, we put it into the atmosphere, so the sub had to remove it. We had a piece of equipment called a CO2 Scrubber (also used on spacecraft), that would vacuum (air inductor), the air on board and then absorb the carbon dioxide through a chemical filter so it would no longer be in the air we breathed.
Anyhow, the above is why I’m still alive to this day. 😊