Falling asleep and waking up are controlled by a number of chemical changes in the brain and the blood. Foods and medicines that alter the balance of these chemicals also can affect how well we sleep.
For example, caffeine, which is found in coffee, tea, soda and chocolate, can cause insomnia (lack of sleep). Antidepressants, smoking, alcohol and other drugs can cause a loss of REM (rapid eye movement) sleep.
Because caffeine is a stimulant, most people use it after waking up in the morning or to remain alert during the day. Caffeine cannot replace sleep, but it can temporarily make us feel more alert by blocking sleep-inducing chemicals in the brain and increasing adrenaline production.
Caffeine can have a stimulating effect as quickly as 15 minutes after it is consumed. It takes about 6 hours for one half of the caffeine to be eliminated. Avoid caffeine close to bedtime. For more info, see a comprehensive list of caffeine content in various beverages, food items and drugs (FDA, 2013).
Alcohol has been researched for its effect on sleep for many years. Studies show that in non-alcoholics who occasionally use alcohol, both high and low doses of alcohol initially improve sleep, although high alcohol doses can result in sleep disturbances during the second half of the sleep period. However - we rapidly develop tolerance to the sedative effects of alcohol and it interacts with sleep deprivation to exacerbate daytime sleepiness. Similarly, consumption of alcohol and other drugs (cocaine, ecstasy, etc.) have been shown to result in lower quality sleep.