i have no problems falling asleep anymore, but i used to. the reason it's not a problem anymore is probably a mixture of many things: financial security, a stable relationship and, somewhat surprisingly, a TODO-list app i actually use. the last one sounds a bit banal, but i used to jolt up and worry about having forgotten some important task.
other techniques and factors:
* going to bed when you're actually tired: sounds somewhat obvious, but people ignore it
* better screen hygiene: this never really worked for me and i never seriously tried it because it wasn't really necessary
* [the military technique](https://www.verywellmind.com/military-sleep-method-7111161): breathing and muscle relaxation together with a repeated mantra. i tried this for some time with varying success. my daugther loves it though - if she can't fall asleep i caress her limbs while mumbling in a soothing voice: "your leg feels very tired, it's falling asleep, your foot is also very tired, your back is very tired, ..."
* for myself, i had better success with thinking - mostly fantasizing - about or planning things i like, for example having (unrealistically great) success with a project, thinking about a multi-day bike tour i'd like to do, inventing a "deus ex machina" device that changes humanity for the better and turns the world into a paradise
today i read about [cognitive_shuffling]: https://www.bbc.com/future/article/20260311-cognitive-shuffling-the-micro-dreaming-technique-that-helps-your-brain-to-rest