It's 2 o'clock in the morning. You've been lying in bed for the past 2 hours trying to calm yourself down and fall asleep, but the thoughts in your head just don't want to settle down. You're running scenarios, envisioning outcomes, and imagining dialogs. Looking at the watch you realize you have just a few hours more of sleep before you'll have to wake up. Knowing you'll be tired and ineffective tomorrow, further increases your frustration and makes falling asleep even harder. I'm sure I'm not the only having trouble falling sleep at night and that many of you experience the same problems. I consider insomnia a predicament of intellectual work. I'm sure a miner digging coal the whole day is so physically exhausted in the evening that he has no problems falling asleep. But programmers and other intellectual workers spend their days sitting on their asses with brain being the only active part of their bodies. No wonder then that body isn't feeling tired and brain just doesn't want to shutdown when time comes to go to bed.
I'm having trouble falling asleep my whole life. Over the years I've developed many coping mechanisms how to reduce amount of sleepless nights with the most important one being regular exercise. On the days I go climbing, run, or play badminton I rarely have trouble falling asleep. But when circumstances prevent me from being physically active, the restlessness returns. Another very effective way how to calm down before sleep is to stop working at least one hour before the bed time and to spend the down time reading a book. Avoiding computer and television screens also helps in calming oneself down.
Unfortunately, I'm not always disciplined enough to follow this advice and in such cases I pay dearly for my lack of self-control with hours and hours of rolling in a bed left with thoughts I don't want to have but which I cannot resist.