For years I fell asleep thinking about some math problem I was working on. Worked wonders, never had any issues falling asleep.
Then I left academia, and were no longer thinking about math all day. An unforeseen consequence: I started having issues falling asleep.
Now I need to regularly look up puzzles or maybe challenging programming problems, just to have something relaxing to fill my mind while falling asleep.