Allergies? A cold? Acid reflux? No matter what the cause, there’s a simple reason behind all your hacking: “A cough is a protective mechanism to clear your airway,” explained Dr. Jonathan Parsons, director of the Cough Clinic at the Ohio State University Wexner Medical Center.

While it’s impossible to always pinpoint a cough by how it sounds, there are some key differences to give you clues as to what’s going on. Here’s how to tell what that cough really means.

RELATED: 15 Diseases Doctors Often Get

Postnasal drip
Sounds like: Either a dry or wet cough. It’s caused by mucus dripping down your throat (due to either allergies or a cold), which tickles nerve endings, triggering coughing, Parsons said.

Other telltale symptoms: The cough is worse at night; there’s a tickly feeling at the back of your throat. If it’s due to allergies you may also have itchy eyes and sneezing.

Diagnosis and Rx: If you suspect allergies, try an over-the-counter antihistamine. But if that doesn’t help after a couple weeks, see your doctor, who can refer you to an allergist for skin testing. If it’s due to a residual cold, you can try natural remedies like saline washes and steam to help relieve congestion, but if the cough lingers for more than a week see your doctor to rule out a sinus infection, which might require antibiotics.

RELATED: Your 12 Worst Allergy Mistakes

Asthma
Sounds like: A dry cough that ends with a rattle or wheeze. People with asthma have inflamed airways, which can cause difficulty breathing as well as wheezing and coughing.

Other telltale symptoms: The cough gets worse at night or while exercising; chest tightness; shortness of breath; fatigue

Diagnosis and Rx: To check for asthma, your doctor will most likely order spirometry, a lung function test, he said. To treat it, there are two types of medications: quick-relief drugs (bronchodilators like albuterol, which make it easier to breathe) and drugs you take daily to keep asthma under control, such as leukotriene modifiers (like Singulair).

GERD
Sounds like: A dry, spasmodic cough. Short for gastroesophageal reflux disease, GERD is when acid from your stomach backs up into your esophagus. It’s actually the second most common cause of chronic cough, causing about 40 percent of cases, according to a 2006 review published in Nature.

Other telltale symptoms: Your cough gets worse when you’re lying down or eating. “The classic sign is coughing that starts as soon as you lie down in bed at night,” said Dr. Parsons. About 75 percent of GERD patients with chronic cough have no other symptoms, but if you do they can include heartburn and hoarseness.

Diagnosis and Rx: Tests may include an x-ray of your upper GI tract and/or an endoscopy (where your doctor inserts a thin, flexible tube down your throat to examine it). GERD is treated with OTC or prescription meds to reduce acid production, like Pepcid AC, Zantac, or Prilosec.

RELATED: 11 Surprising Symptoms of Acid Reflux

COPD
Sounds like: A chronic, hacking cough that produces a lot of mucus, particularly in the morning, Parsons said. COPD, or chronic obstructive pulmonary disease, includes both chronic bronchitis and emphysema; the main cause is smoking.

Other telltale symptoms: The cough gets better as the day progresses; shortness of breath, especially with physical activity; wheezing, fatigue, and chest tightness.

Diagnosis and Rx: Your doctor will usually recommend lung function tests such as spirometry and a chest x-ray. The disease is treated with meds like bronchodilators and inhaled steroids; it’s also imperative to stop smoking. In extreme cases, you may need oxygen therapy.

Medication-related cough
Sounds like: A dry cough. A group of drugs known as ACE inhibitors are commonly prescribed to treat high blood pressure; they can cause cough in about 20 percent of patients.

Other telltale symptoms: Cough begins a few weeks after starting these meds, Parsons said.

Diagnosis and Rx: Talk to your doctor. If your cough is mild, you may be okay switching to a different ACE inhibitor, he said, but if it’s severe, you’ll want to switch to another type of blood pressure med entirely, such as an angiotensin receptor blocker or ARB, like Cozaar.

RELATED: 11 Weird Things That Make Your Seasonal Allergies Worse

Pneumonia
Sounds like: Initially a dry cough which after a few days turns to a wet cough with yellow, green, and/or red or rust-tinged mucus.

Other telltale symptoms: Fever, chills, trouble breathing, pain when breathing in deeply or coughing

Diagnosis and Rx: Your doctor can usually tell if you have pneumonia by listening to your chest with a stethoscope, although she may order an x-ray and blood tests to determine if it’s viral or bacterial, Parsons said. Treatment for the latter is antibiotics; if it’s viral, the only remedy is rest, OTC cough meds, and chicken soup.

Whooping cough (pertussis)
Sounds like: A severe, hacking cough that ends with a whooping sound as you breathe in. While this disease used to be extremely rare thanks to vaccines introduced back in the 1940s, it’s now seeing an upswing—in 2012, there were more than 48,000 cases reported, the most since 1955, according to the CDC.

Other telltale symptoms: The first symptoms are similar to the common cold: stuffy, runny nose, watery eyes, fever, and cough. But after about a week the classic coughing signs emerge, with hacking so intense you may throw up or turn red or blue, he said.

Diagnosis and Rx: Pertussis is diagnosed with blood tests and a chest X-ray. It’s treated with antibiotics.

This article originally appeared on Health.com.