I struggle with insomnia too. But I learned to get 3 to 4 hours sleep every night by setting my bedtime at 10pm. And now my brain knows when it's sleep to close my eyes without me checking the time.
No matter what I'm doing, once it 10ish, I get sleepy and if I don't obey and close my eyes, I get split headaches. But once it's 1am, the sleep clears from my eyes.