Respiratory System
Breathing

This area is covered in a pleural membrane, forming the airtight pleural cavity, which allows breathing to take place. Air is drawn in and out of the lungs by changes in pressure and volume.
Inhale. Intercostal muscles contract, moving chest up and out; the diaphragm contracts and flattens. These increase the volume, so decrease the pressure, thus drawing air into the lungs.
Exhale. Intercostal muscles relax, chest moves down and in, the diaphragm relaxes, and domes upwards. Volume decreases, pressure increases and air is forced out of the lungs.
Here is the structure of the lungs and an alveolus:

Air goes into the lungs via the trachea, through the bronchi, bronchioles and then into the alveoli, where CO2 diffuses out of the blood, into the alveoli and is exhaled. And O2 diffuses into the blood stream and is transported around the body see circulation
Respiration
To produce energy, cells must respire. The primary type is aerobic respiration...
Glucose + Oxygen
Carbon dioxide + Water
C6H12O6 + 6O2
6CO2 + 6H2O
If there is a lack of oxygen, for example during vigorous exercise, cells will respire anaerobically to produce energy...
Glucose
Lactic acid + Energy
In this respiration, far less energy is produced compared to aerobic and lactic acid will tire the muscles.
Anaerobic respiration causes oxygen debt. Where lactic acid is produced and builds up in the muscles. After you finish exercise, it is still there and you have to 'pay back' the debt to break down the acid. After you have breathed in enough oxygen to break down all the lactic acid, the debt has been 'repaid'.
