Each action whilst exploring a derelict requires a given amount of Stamina and O2. Some actions require more than others but in general you cannot move or do any action of you have less O2 or Stamina than required.
Your toon is not allowed to reach Zero O2 as this would mean you were dead. The Bug out option uses 1 unit of O2 so one unit is held in reserve, after all you don’t want to die on-board a derelict now do you!
Stamina is a measurement of your ability to carry on moving around and continue exploring. Insufficient Stamina means you will need to either wait for it to replenish or add some more from the Medical Screen.