The reason Vicks Vaporub helps stop coughing when you put the Vicks on your feet is that the Vicks stimulates nerves in your feet.
When the Vicks stimulates the sensory nerves in your feet they help stop the coughing cycle so you stop coughing.
I didn't believe it at first when my friend told me to put some Vicks on my feet to stop coughing but I tried it anyway and it actually did work like she said.
I asked a doctor and he told me that it was likely due to the sensory nerves being stimulated by the Vicks as it absorbs into your skin.
You can also apply some Vicks to your neck or under your nose to breathe it in or breathe in some Vicks directly and your coughing will stop and it will also help with congestion as well.
Taking a steamy hot shower and breathing in the steam can also help get rid of coughing and help relieve congestion as well.