- Make your bedroom dark, quiet and cool
- Get a memory foam pillow
- Install blue-light filter on your phone, laptop or desktop (Twilight on Android, f.lux on Mac & Windows)
- Have your Vitamin D levels checked, take supplements if necessary
- Take 0.3 mg of Melatonin if you're having trouble sleeping
- Read Say Good Night to Insomnia 
I recently bought this sleep tracking thing which works really well: https://www.beddit.com/ It's a thin strip that goes under your sheets and talks to your phone. It tracks heart rate and respiration and as far as I can tell it's quite accurate.
The things I've found most helpful are cognitive restructuring and the relaxation response. Both of which are recommended in this book: https://www.amazon.com/Say-Good-Night-Insomnia-Drug-Free/dp/...
Cognitive restructuring is part of the CBT stuff mentioned by the author. You catch yourself thinking thoughts like, "Oh shit I'm going to be so stupid tomorrow" and argue against them with thoughts like, "I've managed to do my job on no sleep before and I can do it again. Worrying won't help."
The relaxation response is very similar to mindfulness meditation: you systematically relax every muscle in your body while taking slow deep breaths that expand your belly. You do this for 15 minutes at some point in the middle of the day. You can also do mini versions of it for shorter sessions integrated into your regular activities. The point is to lower cortisol levels. If your cortisol levels get elevated during the day, they tend to still be high at night which makes it hard to sleep.
Get dozens of book recommendations delivered straight to your inbox every Thursday.