Dr Beaudoin says that when the brain starts shuffling through a series of nonsensical images, the primitive brain gets the message that it's time to log off and fall asleep.

"I thought, 'There must be a bunch of signals it can abstractly pick up on'. If we look at sleep onset in humans, there would be some cues," he says.

So he came up with the concept of the cognitive sleep shuffle, where you do the sleep onset work for your brain, feeding it a series of random images to lull it to sleep.

One way to trial cognitive sleep shuffle is via Dr Beaudoin's MySleepButton app, you set a timer then listen to a voice say random objects, moving through everything from "jaguar" to "pencil" to "bird on a branch".

With app reviewers describing the technique as "life changing" and "the only thing that works every time", it's clearly worth a try for insomniacs.

And if you don't want to use an app or contend with headphones in bed, you can DIY by choosing any word, then imagining an image for each letter in that word. So say you chose the word "sleep", you might think of "sailor" for s, "leopard" for l, "echidna" for e, "egg" for e and "plant" for p.

Think of it like an insomniac's acrostic poem. It's a nifty way of generating random images that don't come with associated emotions, like what would arise if you had to visualise "credit card bill" or "mother in law".

"If you can get a person to perfectly simulate sleep onset they will be in sleep onset and will fall asleep," Dr Beaudoin explains.

But he warns against thinking of the cognitive sleep shuffle as a single solution.

"It's not a panacea – it's an extra tool in your toolkit," he says.

"You still need a wind down routine at night. Dim the lights, relax and [implement] everything else you have learnt about sleep hygiene and avoiding arousal."