What is the function of the epiglottis?

It blocks the airway to the lungs while swallowing to prevent food or liquids from entering the lungs.

It blocks the airway to the lungs while swallowing to prevent food or liquids from entering the lungs. It prevents us from choking by covering the larynx when we swallow.