I've been a rubbish sleeper my entire life, and when I'm going through a bad patch (normally stress does it to me) this is what works for me:
No alcohol/ real coffee at all (this is actually one of the reasons I stopped drinking, I know that's a bit depressing). Instant coffee in moderation is fine but I know lots of people think it's horrible!
Go to bed and get up at same time every day until you're sleeping normally again, weekends included, however badly you've slept, and don't spend more than 8 hours in bed.
Get some
outside exercise every day (just walking is fine).
Don't nap during the day, and don't spend time in your bedroom if you can avoid it - you have to reprogram yourself to associate it only (well mostly

) with sleep. Don't worry during the day about whether or not you'll be able to sleep.
If you wake up don't lie awake fretting, think 'at least I am getting some rest' and be calm and think of other things, because you always get your sleep cycle back eventually! I just lie there, but partner who is insomniac too gets up and reads and that works for him. Also, sometimes when you think you haven't slept at all, you actually have and you don't realise (I know that sounds mad, but it is true.)
I've heard good things about valerian too. Good luck!