Chronic insomniac here.
Runs in the family.
I also eliminate caffeine after 2 p.m. Sugar, too, if I can. Also, no water or other drinks after 8 p.m.
I'm okay at FALLING asleep. It's the STAYING asleep that eludes me.
Melatonin helps. But if you have thyroid issues, I've read recommendations against it. I take thyroid meds, so I limit the melatonin I take to days when I feel the situation will be desperate.
Since I can't kick DH out of bed, earplugs are a given for me. Or rather...one. I sleep on my right side, so I get by with a plug in my left ear only.
A big glass of water helps when I'm twiddling my thumbs at 3 a.m. But that can create wake-up issues of its own.