Caffeine, which is found in coffee, cola, certain teas and chocolate, can take up to eight hours to wear off. Nicotine is also a stimulant that can make it difficult to sleep. Drinking alcohol may help you get to sleep, but the quality of sleep is bad. It keeps you in lighter stages of sleep and causes you to wake up in the middle of the night when the initial sedating effect wears off.
National Heart Lung and Blood Institute