I've been suffering from insomnia since last year. To clarify, I'm talking about nights when my mind is either jumping from one place to another, imagining conversations with future doctors (I have an undiagnosed health condition which, after visiting many doctors in my country, a conclusive diagnosis is elusive) or interviews (I've been learning web development since last year but I'm still unemployed).
The combination of turning the lights off in my room, watch something relaxing/calming (that doesn't make me laugh hard or scared) for 1 hour before bed helped me, BUT I also had to use night light for my monitor (flux). I can get at best around 6 hours of sleep and has become my norm as my neighbors can get loud early morning.
Also, I always use relaxing apps to sleep. Rain sounds, white noise, music, I just install and uninstall them 3 times a week trying stuff out.