Epiglottis

The epiglottis is a leaf-shaped flap in the throat that prevents food and water from entering the trachea and the lungs. It stays open during breathing, allowing air into the larynx. During swallowing, it closes to prevent aspiration of food into the lungs, forcing the swallowed liquids or food to go along the esophagus toward the stomach instead. It is thus the valve that diverts passage to either the trachea or the esophagus.

Wikipedia CC BY-SA 4.0