Falling asleep is usually not that difficult, as long as you have had a reasonably active day and you have a regular sleep cycle, it is not that arduous or difficult to fall asleep. However, there are a number of drugs, including nearly universal ones like coffee, that can have a dramatic effect on our sleeping habits.
During the day there is a chemical process occurring in our brain that make us tired. A chemical called adenosine builds up in an area of our brain while we are awake and as the levels increase we get increasingly more tired until we fall asleep. Coffee actually temporarily blocks the brain’s adenosine receptors in the part of our brain that regulates sleep. This lasts for up to four hours, after which the effect wears off and we feel tired again. If we do manage to get to sleep while our receptors are blocked then our sleep can be influenced. Caffeine generally decreases the amount of slow wave and REM sleep we have and can lead to us waking more in the night.
On the other hand, alcohol is often used as a sleeping aid, but though it can help you drop off, it has adverse effects on your sleep. It can make you wake more during the night and in general lessens the recuperative nature of your sleep.