Hello Harriet,
The epithelium cell lining the lung contain goblet cells which are the source of sero-mucus secretions. Ciliated cells in the epithilium push the mucus in a wave like manner, keeping the lungs clean of bacteria. Mucus traps bacteria, dust and other small particles which enter the lungs.
Alveoli, the structures in the lung where gas exchange occurs, are kept moist by the secreted mucus which helps keep them clean.
Do let me know if you have more questions about this.
Best
Sanjay