Lactic acid is an organic acid that is mainly produced in muscle cells and red blood cells.
In the absence of oxygen, the enzyme lactate dehydrogenase converts pyruvate to lactate.
During the reaction, NADH is oxidized to NAD+.
Glycolysis (the process of converting glucose to pyruvate) results in a net gain of ATP and the reduction of the coenzyme NAD to NADH.
So, in order for glycolysis to occur, a constant supply of NAD is required.
In anaerobic respiration (without the use of oxygen), pyruvate is converted into lactic acid by NADH, which donates H+ to pyruvate to produce lactic acid and NAD.
This is then reused in glycolysis to keep the cycle going.