There is an amazing trick that I now use almost every time I want to sleep: the 4-7-8 breathing method. I don't remember using it and not falling asleep in less than 5 minutes, whatever the stress I was in.
I used this for a while, combined with (usually once, before the breathing technique) a sort of "bed yoga" thing, tightening muscles and then relaxing them until I start to feel at-one with the bed, an unusual feeling I can't much describe.
I now don't have to consciously do the breathing counts or the exercise; my brain and body can find their way to that same place with just careful, slow breathing with the long exchale, and a focus on that feeling.
But on its own, the 4-7-8 trick is enormously impressive. You don't even have to trust that it works. Though no caffeine after 2pm probably helps too.
Yeah this works in a lot of situations but I've learned it as 4-8-8 like 20 years ago out of some self-help book I don't even remember the name of. Barring the garbage about "yoga mystic woo woo" stuff I've used it to calm down in all kinds of situations that were stressing me out. Not sure about sleep though, as I've rarely had issues getting to sleep, waking up is the tough part.
As a few of the commenters here are pointing to different breath patterns, and each has some science behind them, but what can't be ignored is that counting these breathing patterns is giving your brain a boring yet focused activity which aims to prevent the mind wandering and getting caught up in the thoughts that often keep people awake.
https://edition.cnn.com/2022/09/16/health/4-7-8-breathing-te...