A virus, bacteria, or fungus infects air sacs in your lungs, which fill with fluid or pus. You may have a temperature, find it hard to breathe, and cough up thick mucus. It can be serious, so see your doctor if you have trouble breathing, chest pain, or if your fever won’t end. If bacteria are to blame, antibiotics can help. Other types are harder to treat, but rest and meds can make you feel better and stop it from getting worse.
Your airways narrow and swell, which makes it harder to breathe and may make you cough up mucus. It can be an allergic response to things like pollen, dust, or smoke. But exercise, cold air, the common cold, and even stress can trigger it. Your doctor can help you figure out what brings on your asthma and how to avoid it. You may get medication to inhale that helps you breathe during an attack or pills that help control your symptoms.