Suppose a cell doesn't have oxygen available. Maybe the cell happens to be on the moon, or maybe the cell's owner is sprinting away from a lion and using up all the oxygen at the moment. Rule #1 of oxidative phosphorylation—stay away from lions. The cell can do glycolysis as usual, but it can't run the citric acid cycle or electron transport chain since oxygen isn't around to accept extra electrons.
In environments without a lot of oxygen, like the deep ocean or your bedroom (seriously, clean it up), cells can use anaerobic respiration to break down food into chemical energy. This type of metabolism uses a reactant other than oxygen to accept electrons in the electron transport chain.
Sorry to break the news to you, but if that cell is on the moon, it's actually out of luck. There's got to be something in the atmosphere to accept electrons. Science can be a downer sometimes, and the generation of ATP on the moon is one such low.
If a cell has a short supply of oxygen because it happens to be in a body running away from a lion at full speed, it won't use anaerobic respiration because it can't. Anaerobic respiration is a trick reserved only for a select few microorganisms. For example, some bacteria that live in vents near the ocean floor are called sulfate-reducers because they use sulfate instead of oxygen as their electron acceptor. Microbes called methanogens also use anaerobic respiration, using carbon dioxide as an electron acceptor and making methane in the process.
Cells that can't do anaerobic respiration can simply use the small amounts of ATP made by glycolysis, but they need a mechanism to oxidize NADH to regenerate NAD+. Otherwise, the cycle stops.
To keep the cycle going, cells will start fermentation. Fermentation doesn't make any ATP, but it does regenerate NAD+ to extend glycolysis so that the process can keep running and keep producing small amounts of ATP.
Fermentation comes in two types:
Lactic acid fermentation occurs in bacteria, fungi, and animal muscle cells. It's a pretty simple follow-up to glycolysis: the pyruvate molecules are reduced to lactate, while NADH is oxidized to NAD+. In this way, NAD+ is replenished and cycles back through glycolysis.
Why should we care? Lactic acid bacteria is why. Lactic acid fermentation is the process used in the dairy industry to make cheese, yogurt, and buttermilk. We also have lactic acid fermentation to thank for pepperoni, sourdough bread, and pickles. Thank you, lactic acid bacteria.
Lactic acid fermentation
Alcohol fermentation is pretty similar to lactic acid fermentation. Instead of the pyruvate being reduced to lactate, it's reduced to ethanol and lets off two molecules of CO2 along the way.
Two kinds of organisms can do alcohol fermentation: bacteria and yeast (yeast, by the way, are fungi). Humans "use" alcohol fermentation in another way, co-opting it to make bread, beer, and wine. That's a talk for another day, though.
Methanogens are from the third domain of life, the Archaea. Some methanogens can be found in the guts of cows, where they contribute to methane-filled cow farts. In fact, some farmers are working on ways to harvest this natural gas (pun intended) to supply the energy needed to run their farms