In most cases, coughing up mucus means your body is working to fight off an infection, and it is in the healing stages. Drink plenty of fluids to help thin the mucus.