When I was a child, I found it horribly difficult to get to sleep on Christmas Eve.
I would lie in bed, desperately wanting to sleep and so to hasten the arrival of Christmas morning.
But, for long dreary hours, sleep would elude me.
Then, one year, I was determined to settle, once and for all, the "Santa question".
I decided to stay awake, all night if necessary, and see for myself who it was that placed the Christmas presents at the foot of my bed.
Ironically, that was the one year that I dropped off immediately and slept soundly till morning.
I discovered something that every insomniac knows, that the more desperate you are to sleep, the wider awake you are likely to be.
The fact that sleep eludes you most when you desire it most is one of the two great ironies of sleep.
The other is that we rarely want to get into bed at night when it is time to sleep and we rarely want to get out of bed in the morning when it is time to wake.
Charles Caleb Colton, a 19th-century English cleric and writer, put it neatly: "The bed is a bundle of paradoxes: we go to it with reluctance, yet we quit it with regret; we make up our minds every night to leave it early, but we make up our bodies every morning to keep it late."
This is true for many of us, much of the time.
Sleep helps us to focus better and think more clearly, and boosts creativity as well as problem-solving.
After a long day's work, we are reluctant to curtail our precious "me" time by going to bed at a sensible hour.
And, in the morning, we are equally reluctant to quit our beds and begin the new day.
I have found that this problem - getting into bed at night and getting out of it in the morning - has been most acute during those periods of my life when I have felt most unhappy.
At such times, bed has been the very last place I wanted to be at night, but the only place I wanted to be in the morning.
By contrast, during the happiest and most fulfilling periods of my life, I have taken pleasure both in going to sleep and in waking up.
Dr Rafael Pelayo, a sleep specialist at the Stanford Centre for sleep science and medicine in California, said: "Your life is a reflection of how you sleep, and how you sleep is a reflection of your life."
That certainly rings true in my experience.
And it's not just me. Research has shown that there is a clear link between mental health and quality of sleep.
The majority of patients with depression experience sleep disturbances of some kind. And persistent sleep problems can trigger or exacerbate episodes of depression.
Depression aside, quality of sleep is important to all of us.
Sleep may seem like a passive and unproductive part of our lives. But, in fact, the opposite is true.
Sleep plays a vital role in repairing and rejuvenating our bodies and brains.
It boosts our immune systems, helps to regulate our moods and reduce stress.
Sleep also helps us to focus better and think more clearly, and boosts creativity as well as problem-solving.
Clearly then, it is not a good idea to sacrifice an adequate night's sleep for an extra hour or two in front of the TV.
But how much sleep is adequate?
Well, that varies from person to person.
One thing is certain. As the American playwright Wilson Mizner once wryly observed: "The amount of sleep required by the average person is five minutes more."
•Gary Hayden is a science and technology writer. His new book, Walking With Plato, is out at major bookshops here.