The diaphragm contracts, and the lungs expand, so the oxygen goes in, which means that inhalation process occurs. On the other hand, when the diaphragm expands, and the lungs contracts, the carbon dioxide exits the respiratory system, which means that exhalation process occurs.