One of my favourite comic artists ever. His comics are equal parts bleak & funny. Found at https://pbfcomics.com/comics/the-talk/
As a chemist,
Air: A Sabatier reactor uses CO2 and Hydrogen to make methane and water, then the methane can be heated in an oxygen-less atmosphere (pyrolysis) to get hydrogen and elemental carbon, and you can electrolyze the water to get oxygen and hydrogen. the hydrogen from the methane pyrolysis and water electrolysis is enough to use again in the Sabatier reactor, while the oxygen can then be used again to breathe.
For the food: A bit harder, for a closed loop like for the air you would need to chemically recycle pee and poo which IS possible, just insanely complicated (and gross, and dangerous).
A better method for food, if you had access to water, would be to turn water into steam, then use the elemental carbon from the Sabatier reactor and the steam to make syngas.
Once you have syngas, make Methanol with it, and then convert the methanol to Formaldehyde with a catalyst.
Once formaldehyde is obtained, use the Formose Reaction to make various sugars.
Then, use the sugars to eat or to feed animals/plants.
Idk about other stuff tho, all the proteins, vitamins etc
it could probably be possible to make them with genetically modified yeast/bacteria that feed on the sugar, but AFAIK this doesn’t exist yet (the above part of air+water to sugar is possible with current technology, tho)