To add:
- No visible clocks. If possible don't check the time at all while trying to sleep. Doing math at night (aka "oh no only 4 hours left") only makes you angry or sad.
- No alcohol. If unavoidable, try to be sober by the time you want to fall asleep. (Dring sooner, if at all.)
- No coffee after midday. Some bodies suck at metabolising it.
- Bedroom should be as dark and silent and comfy as possible. If there's any way you can add comfort, do it.
- For persisting sleep problems: Change position or location. (E.g. turn completely around in your bed, feet at the headrest, or sleep on the couch if comfortable.) Brains are very good at linking a location with a state of mind, and changing things around can help if the thought of your bed stresses you out already.
For severe problems it's probably always wise to check with a physician, or if there's specific stuff in your head that keeps you awake to consider telling a friend or therapist about it. To distance yourself from your thoughts is something everybody can learn and it can be tremendously helpful with stuff like that.