Don't watch telivision OR USE THE COMPUTER after two hours before you want to go to bed, say 8:30 PM if you want to sleep at 10:30 PM. Don't use your bedroom for anything except sleep, sex and getting dressed.
Read at night, but not in your bed/room. Your brain needs to think "Oh I'm in my room time for sleep, oh I'm in my bed now, definitely time for sleep"
If you're lying awake tossing and turning get up and do something BUT NOT COMPUTER. It's stimulating. Read or make a cup of warm milk or something.
Don't use caffeine after midday.
Get up/wake up 16 hours before you want to sleep, same time every day, regardless of how much sleep you've had. Go to bed a bit more than 8 hours before you want/need to get up, at the same time every day. You need the routine.
For example a good time to set the alarm and get up every day might be 6,7 or 8 AM and you have to stick to it.
Don't drink alcohol/smoke pot. i've found they make my insomnia worse. Definitely don't take uppers.
Have a hot bath every night. Use that time to relax and think so you have done your relaxing and thinking by the time you go to bed.
One of my problems is I think, daydream too much and I am tempted to do that when I'm trying to sleep. Maybe it's to do with ADHD for me, I don't know it's just like so hard to shut off the la la land it distracts me from work, life, sleep everything.