When exercising energy from respiration is used to contract muscles and the breathing rate and breath volume increase to get more oxygen into the blood : heart rate also increases to get oxygenated blood around the body faster
When the body cannot supply enough oxygen it starts respiring anaerobically which released lactic acid which is painful : long periods of exercise leads to muscle fatigue and muscles stop contracting effectively
After anaerobic respiration the body will have and oxygen debt which is needed to remove lactic acid from the cells
Blood can enter muscles and transport lactic acid to the liver where it is converted back to glucose