Having a hard time staying asleep. Here is an ordered list of tips

Your mum was right: Go to bed and wake up at a consistent time. Weekends, weekdays, holidays, etc — always stick to a routine! – Amjad Masad

I’ve dealt with poor sleep for many years. As someone who’s excited & energetic, I had a hard time going to sleep. And as a startup founder, I’ve had a hard time staying asleep. Today I sleep ~8 hours, and almost every aspect of life is better. Here is an ordered list of tips:
1. Schedule Your mum was right: Go to bed and wake up at a consistent time. Weekends, weekdays, holidays, etc — always stick to a routine! If you sleep late after a night out, wake up early. If you’re tired, resist going to bed early. Eventually, sleep will become automatic.
2. Sleep hygiene It’s all about programming yourself for better sleep. Keep your room a sleep sanctuary. Resist working in there. Or even reading. The more things you associate your bedroom with, the weaker its automatic connection to sleep is.
Between the first three tips and the rest are a very big drop in ROI. I know that sleep gadgets are all the rage, but in the end, without a good schedule and good hygiene you’re operating on the margins. With that being said, here are the rest:
4. Temperature Room temperature is very important for sound and deep sleep. I found that if I’m waking up in the middle of the night it’s generally because I’m hot. I prefer 63-65 degrees. If you can’t control your room temperature, @eightsleep helps here.
5. Don’t eat late It will make it harder to fall asleep and your sleep quality will suffer. I’ve found that 3-5 hours from the last meal is ideal for sleep (being too hungry can also be a problem for falling asleep so make sure you eat a good amount of fat for your last meal).
6. Limit coffee and never drink alcohol Coffee has a 5-hour half-life so if you want to go to bed at a reasonable hour never have it past noon. Alcohol is practically poisonous for your sleep. (Maybe a glass of wine with dinner every once in a while is not the end of the world)
7. Avoid late-night stimulation While I think “winding down ritual” is a bit oversold, I think overstimulation before bed can be terrible. Resist tweeting that hot take at midnight, and don’t watch intense TV.
8. Avoid naps Naps can be really great, but only once you’ve mastered your sleep. Before you’ve had a solid sleep schedule, naps — especially close to bedtime — can really set you back.
9. Sun in the morning When you wake up go outside or get exposed to natural light. Even better if you get sun in your bedroom because it can serve as a natural wake-up cue.
10. Supplement magnesium I’ve tried dozens of supplements and the only thing that has had any measurable impact was magnesium. It made it easier to go to sleep and stay asleep. I have no idea by what mechanism.
Addendum 2: If you really want a “pick me up” afternoon, try going for a walk. If that doesn’t work, nicotine gum might work. It’s shown to not nearly be as addictive as smoking and has a half-life of just two hours. @lucynicotine is great!
Addendum 3: If you go through a period of bad sleep, don’t sweat it. People can function on really low sleep (for extended periods of time). Poor sleep is often the result of sleep anxiety, so the worst thing you can do is stress too much about it.