I've had chronic insomnia for about... I guess about 4 years now? So I'm very particular about my sleep habits because otherwise, I just don't sleep.
My room has to be completely dark and completely silent. All blinking lights from any electronics charging have to be covered up, the kitchen light upstairs has to be turned off or the door at the top of the stairs has to be closed so the miniscule amount of light from it doesn't show in the doorframe of my basement room. Lots of little details that I have to check before bed everynight, in case some sort of covering shifted during the day. The speakers on my desktop have to be physically turned off because otherwise they emit the tiiiiniest of static noises which will keep me up all night if I've forgotten to turn them off.
As for my methods for actually getting to sleep... I take a melatonin pill about 30 minutes before I want to get to sleep, and that's when I sign off my computer, turn off my game consoles, or otherwise start winding down and trying to avoid electronics. I brush my teeth, change into pyjamas, get my stuff ready for the next morning... and then when I'm ready to crawl into bed and try to sleep, I take my actual sleeping pill which generally takes about 10-30 minutes to kick in and turn my lights out to sleep.
Recently, even though LCD screens are awful for sleep, I'd trained myself to fall asleep to a very specific Youtuber's videos. I feel bad saying it because it's not like I find him boring or anything, but it's a Minecraft LPer (EthosLab, for anyone curious) and I just find it very calming and relaxing. I only ever watch his vids in bed, so my mind simply associates his videos with drifting off to sleep. Then in the morning as I wake up, I finish off the video (often having to go back a few minutes to where I conked out). However, my sleeping pill dosage had to be dropped recently and I'm really noticing the difference the LCD screen makes, so I've had to cut this out of my routine and it sucks because now I can't do the thing I've mentally trained myself to sleep to. :( I'm trying to take up reading instead but it's been about a week and so far my bedside lamp definitely keeps me more awake than my phone screen. Having to lift myself up, lean over to turn out my light, set my book to the side, and then sleep when I feel myself drifting off rather than just turning off my phone and sliding it slightly under my pillow turns out to be a big deal. But hopefully over time I'll successfully retrain myself again. Otherwise it might be time to invest in a better ereader with a backlight, assuming the backlights are healthier. (I've never actually looked into this.)