The diaphragm is a dome-shaped muscle located at the base of the chest cavity. During inhalation, the diaphragm contracts and moves downward, increasing the volume of the chest cavity and allowing air to enter the lungs. During exhalation, the diaphragm relaxes and moves upward, helping to expel air from the lungs.