3 years ago I could no longer fall asleep before 5am and it was severely affecting my ability to concentrate, which as a software engineer is a death knell. Like most, I internalize my problems, exacerbating my frustration, worsening sleep, and creating a negative feedback loop.

Today, I sleep like a baby, and it's INCREDIBLY EASY to fix. Follow these steps, and you'll never have difficulty falling asleep again:

1. Melatonin [1]

Melatonin is how your body knows when it's time to go to sleep. It's produced naturally, but with DSPD (Delayed Sleep Phase Disorder), by definition it occurs later than it should. Taking melatonin an hour before you go to sleep is like a hard reset. I can't overstate this enough. It doesn't matter how much blue light or caffeine you've taken (for the most part) during the day, or how stressed you are, if you take 9mg of melatonin, you'll fall asleep in an hour. Period. Eventually, with some of the below, you can achieve the same affect with 1mg, and once you establish a regular schedule you'll no longer require it at all.

2. Wake Light [2]

A natural sun alarm clock. If you get enough sleep (easy once the melatonin ensures you fall asleep on time), waking up to one of these is a breeze (and a joy).

3. Avoid Blue Light

Same thing as the article states, avoid it. Computers, iPhone, etc...

4. Cold shower [3]

It drops your body temperature and moves your blood away from your prefrontal cortex to your core alleviating your mind from racing.

5. Earplugs [4,5]

My dogs feat clitter clatter across our hard wood floors. My wife wakes up before me. Our house creeks. etc.... Occasionally I also use an eye cover, but it's less impactful.

6. Socks & t-shirt [6]

They help regulate body temperature.

7. Obey Your Sleep Cycles [7]

Our bodies have natural sleep cycles (90m for the first, ~110m for the 2-3rd). When my alarm clock goes off, and I still feel sleepy, I roll over with my eyes facing my wake light and effectively snooze until I feel awake. Eventually the combination of white light and the conclusion of my sleep cycle, leave me feeling awake and alert.

8. Sleep alarm

In my experience, it's been more important for me to set an alarm at night (9:45) to start getting ready for bed, than to set one in the morning. Having a regular sleep schedule allows you to work with your body instead of against it. If you're having trouble sleeping, or you anticipate having trouble, take melatonin until your body starts to adapt to your new schedule and it's no longer necessary.

9. Relax

1 hour before your sleep alarm you should be doing something relaxing. It won't matter if when your sleep alarm goes off, you're running around busily doing things. I make sure I'm doing something relaxing like watching TV or reading a book in bed for at least an hour before my sleep alarm goes off.

10. iPhone Wakeup

One thing that helps wake me up on those difficult mornings is to crank the brightness on my iPhone and sit and read a few articles. The white light naturally tells my body it's time to start the day, and eventually I don't mind waking up.

Life is so much better now that I can count on fantastic sleep every night!

[1] http://www.webmd.com/sleep-disorders/tc/melatonin-overview

[2] http://www.amazon.com/Philips-Hf3470-Wake-up-Light-White/dp/...

[3] https://www.google.com/search?q=cold+shower+before+sleeping

[4] http://www.amazon.com/gp/product/B0068HC0X4/ref=oh_details_o...

[5] http://www.amazon.com/gp/product/B000H7MMP2/ref=oh_details_o...

[6] http://lifehacker.com/wear-socks-to-fall-asleep-easily-47655...

[7] http://en.wikipedia.org/wiki/Sleep#cite_ref-17