If you've been struggling to drop off recently or spend more nights than you'd like to admit tossing and turning, you know how frustrating it is to be denied a good night's sleep.

And while most of us blame external factors like noise, temperature or mattress quality, it turns out we all need to start looking inwards if we want to improve our sleep patterns.

According to scientists at Northwestern University in the US, a lack of purpose in life can contribute to your inability to sleep well.

However, by creating a plan for the following day and the weeks that follow, the individual will greatly increase their chances of enjoying a good night's sleep.

With the help of 823 participants, researchers established that those who could find meaning in their life tended to sleep better than those who struggled to frame their past experiences and future desires.

Commenting on his recent findings, senior author of the study and associate professor of neurology at the University's Feinburg School of Medicine, Jason Ong, said the benefit of purpose cannot be underestimated.

"Helping people cultivate a purpose in life could be an effective drug-free strategy to improve sleep quality, particularly for a population that is facing more insomnia," he reasoned.

"Purpose in life is something that can be cultivated and enhanced through mindfulness therapies," he added.

The results were published in the journal Sleep, Science, and Practice.