I don't actually suffer from insomnia, but for various reasons I do get up frequently in the middle of the night and can sometimes find it quite difficult to get back too sleep due to thoughts crowding my mind.
I have developed a strategy to counter this; I imagine a thruppenny piece coin, enameled with various colours - the type you sometimes see as pendants or cufflinks. I find that focusing on that mental image stops the extraneous thoughts, calms my imagination and helps me drift off to sleep quite swiftly. Why a thruppenny piece? I have no idea - it just works for me, but it has to be highly coloured, more than the one below.
The other solution would be to read, but switching the light on would bring complaints from her indoors. I always read, without fail, on going to bed in the evening and it takes no more than half a dozen pages to send me into the land of nod, regardless of how I feel.