Usually when I suffer from an inability to sleep it's because my mind ends up focusing too hard on things that ground me to reality. Existential dread, worrying about work, thinking about technical problems etc. So often my technique to fall asleep has been to focus my mind on the fantastical. Stimulate my imagination a bit, like what if I was a dwarf in a fantasy universe. This tends to focus my thoughts inwards and…
I do this from time to time as an act of rebellion against the part of me that takes life too seriously. The speech that I give myself goes something like this: "You have this amazing mind that is capable of creating entire worlds. But you've been spending all of your time and energy worrying about stuff. Let's have some fun for a while and practice strengthening our imagination."