The epiglottis is the lid-like cartilaginous structure overhanging the entrance to the larynx. The muscular action of swallowing closes the opening to the trachea by placing the larynx against the epiglottis. This prevents food and drink from entering the larynx and trachea, directing it instead into the oesophagus.
The Greek philosopher and polymath Aristotle discovered the epiglottis around 350 BCE. His text contains the earliest known mention of the epiglottis with an implication to its function as well. In his text, it says “The windpipe, as we have said, is situated in front, and therefore is interfered with by the food. To deal with this difficulty, Nature has contrived the epiglottis.” Here is an illustration and photograph of the epiglottis above the larynx: