About 10 years ago I desperately needed to sort out a chronic insomnia problem. The lack of sleep was really having a negative impact.
Counting sheep was never an option for me. Along with some other techniques I stumbled upon the idea of choosing something specific to remember and to then dream about. For me, the Ulster Grand Prix in 1968 was such a standout memory. So that's where I went. And sleep came so very quickly afterwards.