The diaphragm's main function is to facilitate breathing. When it contracts during inhalation, it lowers and increases the volume of the thoracic cavity, allowing air to flow into the lungs. This contraction reduces the pressure in the thoracic cavity compared to the atmospheric pressure outside, prompting air to fill the lungs. During exhalation, the diaphragm relaxes and moves upward, returning to its dome shape. This action helps push air out of the lungs. Additionally, the diaphragm assists in regulating the pressure in the abdominal cavity, which is essential for activities such as coughing, sneezing, and creating an effective vacuum for various bodily functions.