The oxygen generator creates oxygen from Ice. Ice is a white-blueish mineral (can sometimes be confused with silver or platinum) which can be mined from some asteroids with your drill tool.
- Press "G" to open the toolbar config screen
- click on "Character Tools"
- Drag the "Hand Drill" to a free slot in your toolbar.
- Look for an asteroid with ice (only a few of them have it)
- Press the corresponding number key to equip your drill.
- fly to the ice deposit - HUD icons denoting mineral deposits should appear when you approach an asteroid while having the drill equipped.
- left-click with your drill equipped to mine the ice,
- pick up the lumps of ice which float away
- fly to your oxygen generator and open its inventory by approaching one its terminals (the yellow squares which light up when you point at them from close by) and pressing "K"
- drag&drop the ice from your personal inventory into the oxygen generators inventory
It will then start to produce oxygen which is stored in any oxygen tanks connected to it by conveyor tubes.
An alternative way to produce oxygen are oxygen farms which only require sunlight to work, but you need a lot of them (at least two to stay alive, under the condition that you don't waste any oxygen).
An asteroid with ice:
A lump of ice extracted with the drill tool:
Filling an oxygen generator with ice: