Roughly 30 percent of the population struggles with falling or staying asleep, a problem which can have huge daytime ramifications. Whether it's lost productivity at work or heavy lids behind the wheel, insomnia can be costly. But warm milk isn't the solution. Instead, you need to take back  control of your bed, mind and behaviors. Once you do, sleep will come crawling back to you.

That's according to Peter Hames, co-founder and CEO of digital behavioral medicine company Big Health who created Sleepio, a digital sleep improvement program which has logged millions of users' sleep hours, undergone multiple clinical trials, and is based upon the proven effectiveness of cognitive behavioral therapy (CBT). Here's what he says the sleep deprived can do to take charge of their slumber.

1. Instead of chasing after sleep, try to stay awake.

Hames calls this "paradoxical thinking." Instead of lying there and getting increasingly frustrated with the fact that sleep will not come--try to stay awake. It sounds crazy, but by getting out of bed and abandoning the idea of sleep you're effectively stabbing in the heart all of the anxiety, negative emotions and desperation that come with pining after some shut-eye. "See if you can feel your eyes stay open for just a few minutes more," he says. "As you feel your lids dropping, just say, 'no, no, just a few minutes more' and try and open them."

2. Imagine all the worst-case scenarios which will ensue if you don't sleep.

Take it to a ridiculous level. Imagine being in an important meeting fully sleeping with your head on the conference table while your boss contemplates firing you. The point is to dream up the most absurd thing that could possibly happen if you get zero sleep. By doing so, you're effectively "de-catastrophizing" your tomorrow.

3. Let your thoughts come and go like leaves floating in a stream.

It's a core tenant of mindfulness in which your thoughts do not control you. You notice them, and let them go. They are not you and they're not reality. "If a thought or a worry about the consequences of not sleeping pulls into your mind just disconnect from it and wait for it to go on its path and move through your mind," he says.

4. Stop associating your bed with anxiety.

Your bed should conjure up feelings of tranquility and positivity. Therefore, if you find yourself becoming distressed because you can't sleep, get out of bed. Take that negativity elsewhere. You do not want your mind to associate your bed with anxiety. The only things that happen in your bed should be pleasurable and relaxing. You wouldn't believe the number of insomniacs who equate their beds with negativity, simply because they spend so much of their time there agonizing.  

5. Plan ahead for not sleeping.

Set your thermostat so your living room is warm when you leave your bed. Leave out your favorite book so you have something to do while you're avoiding not sleeping. "Only return to bed if you literally feel your eyes closing, or you feel sleepy-tired," he says. "Not just exhausted, but that feeling of when you can't stop yawning or you actually feel like you're going to nod off."