I can't guarantee following these two rules will always help you sleep, but I can guarantee disregarding them will almost certainly keep you up at night. As evidenced by the fact that I am writing this at 3am PST:
1. Meditate daily.
2. No caffeine after 2pm.