I use a technique where I play a scene out in my head. Always the same scene, always the same outcomes and the same process.
For example "Walking down a beach, see a small shell, pick it up, turn it over and notice the interesting pattern, put in pocket, go to the sea shell stored a few feet down the beach waving at a people, sell the shell, take the money and buy a small rock statue, take the statue home and place it on the window sill... etc"
The trick is make it memorable and not specifically related to your own life so you can't get side tracked subconsciously ("Oh no! I forgot to buy sea shells!!"). I find a narrative works well, and the whole thing tells a story.
The way to get started is when you are EXHAUSTED and ready to fall asleep anyway, and to repeat the same scene/steps every night from that point on. Eventually the series of images and events will tie to "sleep" in your mind and I rarely get past the first few parts of the sequence.
Essentially counting sheep! same idea really. After a while you may get bored of one story and make up another. I've gone though a half dozen over the years I guess.
This technique works for me also. Sometimes I can't stay focused on it, but when I can, that magical garden where I lay on the soft grass beside the gentle stream puts me out most times.
I don't stop thinking? Surprised to see people actively stop thinking in order to fall asleep. Instead I just put the daydreaming neurons on overdrive. At some point I pass out. I rarely notice when it happens, though occasionally I do and become aware that my fantasy is getting mixed up with random images.
Concentrate just at the tip of your nose where the breath touches the tip leaving the body, when your breath in, think "in", when you breath out, think "out". Determine to keep you mind at that, but be relaxed while doing it. Works well when you are already tired, i.e. at the time that you usually go to sleep.
This is like, thought replacement. It's a "Buddhist" technique.
Audiobooks! I listen to The Sleepy Bookshelf, but anything will do, there are lots of free audiobooks on YT etc too.
I use a sleep timer so it'll stop playing after half an hour.
It used to take me up to two hours to fall asleep at night. Long story short, lots of counselling and a few lifestyle changes later I'm usually under in about half an hour. That's still more than average, but pretty good by my standards. What helped me most was:
Limiting caffeine. Not drinking caffeine after midday really helped reduce general anxiousness and racing thoughts.
Learning to meditate. Clearing your mind and defocusing is a life skill. A short meditation in the evening helps wind down, and when you get good enough at it you can kinda just flip into that mode when you need to sleep. Unclench your muscles and focus on breathing.
No screens before bed. I'm not great at sticking to this one, but if I shut down the pc and put my phone down a couple hours before bed and just read or something, I sleep a hell of a lot better.
I'm sure it's just autism, but I start taking machines apart in my head, or go through steps of a project I'm in the middle of. I can walk through step by step of how every part interacts, visualize how it moves and where the wear and contact points are, which tool I need for fastener X, Y and Z.... then go farther down, and think about how each part would itself be cast, machined, welded, and packaged for assembly. Somewhere in the rote repetition of it, I'll pass clean out.
I've been practicing meditation for years, it helps tremendously with just regular ol' psychological well-being and it can also put me to sleep in minutes.
There's a good one I use when I'm trying to sleep, where you mindfully relax all your muscles from your head to your toes, and back up again.
Sometimes I get sleepy, but my brain doesn't stop thinking. I listen to storybooks with music to help me sleep. When I try to count sheep, I end up daydreaming. And when I listen to music, I forget about it and start daydreaming again. If the story is super interesting, I stay awake longer. But the most sleepy audiobooks for me are the boring ones or the ones I already know. Today, I'm trying to write my thoughts down, maybe it will help me stop thinking so much and make my head less full!
Daydreaming for me usually leads to nighdreaming if I'm lying in bed.
But my problem is anxiety. I usually only sleep when my exhaustion overcomes my anxiety; similarly, I get up when my anxiety overwhelms my exhaustion. I'm always some combination of exhausted and anxious and it's an ongoing problem. I have no useful advice to give you, I'm just showing you the dark path I myself tread.
Given my druthers, I read novels until I fall asleep.
I don't stop thinking, it just... gradually gets quieter. Like when you're walking away from someone who's still talking.
Don’t go to bed until I’m about to drop dead from tiredness. I’m out before I hit the pillow that way.