The body keeps most mucus and dirt out of the lungs using a built‑in “filter and conveyor belt” system made of the nose, airway mucus, and tiny moving hairs called cilia.

Quick Scoop

When you breathe in, your airways are lined with sticky mucus that traps dust, germs, and dirt like flypaper so they do not reach the delicate air sacs in your lungs. Tiny hair‑like structures called cilia then beat in a coordinated wave to push that dirty mucus upward toward your throat, where you unconsciously swallow it or cough it out.

The Main Defenses

  • Nose as first filter
    The nose hairs and moist nasal passages catch larger particles before they even reach the lower airways.
  • Mucus lining the airways
    Goblet cells in your airways constantly produce a thin layer of mucus that traps dust, bacteria, viruses, and other inhaled particles.
  • Cilia (the “conveyor belt”)
    Cilia beat more than a thousand times a minute, sweeping the mucus layer upward toward the throat (the mucociliary “escalator”).
  • Cough and swallow reflex
    Once the mucus reaches the upper airway, you either swallow it so stomach acid destroys the trapped germs, or you cough it out if there is a lot of mucus or an irritant.

Why This Matters

This mucus‑and‑cilia system is the lungs’ first line of defense, keeping most dirt and microbes away from the fragile gas‑exchange areas (alveoli). When it is damaged—by smoking, certain genetic diseases like cystic fibrosis, or chronic lung conditions—mucus can become thick and hard to clear, allowing germs to build up and cause infection and breathing problems.

TL;DR:
What keeps mucus and dirt out of the lungs is a combo of sticky airway mucus that traps particles and cilia that constantly sweep that mucus up to be swallowed or coughed out.

Information gathered from public forums or data available on the internet and portrayed here.