Chocolate! Specifically the chemical compound called theobromine. While also in other foods, such as black tea, chocolate contains the highest concentrations. The cocoa itself contains all of the theobromine, so when taking medicinally it is more efficient to eat 100% chocolate, or make a drink from non dutch processed cocoa powder. Theobromine inhibits the vagus nerve thereby stopping coughing. Here's some science: https://www.ncbi.nlm.nih.gov/pubmed/15548587
This is the recipe I use. It will stop your cough for hours, you may need this recipe 2-3 per day until your cough is gone:
3 Table spoons cocoa powder
1 Cup hot black tea
Honey
Make the tea first. Add the cocoa powder, and put enough honey so that it tastes good.