Cough is your body's way of responding when something irritates your throat or airways. An occasional cough is normal and healthy. A cough that persists for several weeks or one that brings up discolored or bloody mucus may indicate a condition that needs medical attention. 
While an occasional cough is normal, a cough that persists may be a sign of a medical problem. 
Some causes of coughs include: 
1. Common cold / Influenza (flu) 
2. Inhaling an irritant 
3. Pneumonia  
4. Allergies 
5. Asthma (most common in children) 
6. Gastro esophageal reflux disease (GERD) 
7. Postnasal drip 
When to see a Doctor: 
Call your doctor if your cough doesn't go away after one week or if you or your child is: 
1. Coughing up thick, greenish-yellow phlegm 
2. Wheezing 
3. Experiencing a fever more than (39.4 C) 
4. Experiencing shortness of breath, chest pain or night sweats
5. Using a medication that may contribute to your cough
6. Inhalation of dust or other foreign objects. 
7. Seek emergency care if you or your child is: 
• Choking 
• Having difficulty breathing or swallowing 
• Coughing up bloody or pink-tinged phlegm 
Cough medicines usually are used only when the cause of the cough is unknown. If you use cough medicine, be sure to follow the dosing instructions. 
Don't give children under age 4 over-the-counter cough medicine without first checking with your child's doctor. 
To ease your cough, try these tips: 
• Suck cough lozenges or hard candies: They may ease a dry cough and soothe an irritated throat. Don't give them to a child under age 6, however, because of the risk of choking. 
• Take honey: A teaspoon of honey can help loosen a cough. Don't give to children younger than 1 year old. 
• Moisturize the air: Use a vaporizer or take a steamy shower. 
• Drink fluids: Liquid helps thin the mucus in your throat. Warm liquids, such as broth tea or lemon juice, can soothe your throat. 
• Avoid tobacco smoke: Smoking or breathing secondhand smoke can make your cough worse. 
Your doctor will ask about your medical history (cough duration, cough type, medications being used) and may perform a physical exam. Your doctor may also order tests to look for the cause of your chronic cough like allergy tests or X-rays to check if there is pneumonia. 
Determining the cause of chronic cough is crucial to effective treatment. In case of having an infection a suitable antibiotic should be given, in cases of allergies an anti-histamine might be given , if you are taking a medication that causes cough (like the ACE inhibitor medication, used for hypertension)  your doctor may switch you to another medicine that doesn't have a cough as a side effect. 
In cases of acute cough, a cough syrup might be given for several days. The choice will depend on different factors, like age, type of cough, medical condition. Don't switch from one type to another if you didn't achieve the needed response, instead you have to refer to doctor to control your symptoms. Always refer to your pharmacist to help you in choosing the appropriate option for you or for your child, especially if you have another condition like diabetes, hypertension, etc.