Guaifenesin is an expectorant that helps to thin and loosen mucus in the lungs, making it easier to cough up the mucus.