I was curious about how oxygen was produced in a submarine. This article says it’s by electrolysis (using electricity to split H2O into hydrogen and oxygen, and then venting the hydrogen outside the sub):
https://www.ussjpkennedyjr.org/how-nuclear-submarines-generate-their-own-oxygen/
The article points out that you need to do something in addition to creating new oxygen. You also need to remove CO2 from the air, which is done by passing the air through calcium hydroxide or sodium hydroxide.
Producing oxygen in a nuke sub: You’re part way there. The reactor and the steam system need fresh water makeup so the first step is desalinating seawater and flushing the solids overboard. Then the stash of fresh water is split by electrolysis to get the makeup oxy. The crew is already exhaling CO2 so the ship needs to moderate the atmospheric CO2 to keep it close to outside ambient. There is another machine called a “CO2 Scrubber” that separates the CO2 from the airflow and dumps the mix overboard. That machine(s) used some snake oil called monoethanolamine (just called Amine) to trap the CO2 and make it disposable.
Most of the crew don’t even know it’s there but for long under stays it is their best friend.