Are you getting your eight hours of sleep each and every night? Are those actually eight quality hours of proper rest, or are you tossing and turning the whole time? Even at the faster pace of modern society, we all still need to slow down and catch some “Z’s.” So, how do you do that?

If you’ve ever wondered how to get better sleep and how to overcome some of the most typical sleep problems, you’ve come to the right place. The 12 how to sleep better tips and tricks described below will have you going beddy-bye in no time. Snuggly teddy bear optional, of course.

Get Away from the TV, Computer, Tablet, Smartphone…

Think about this from an evolutionary perspective. Our ancestors woke up when the sun rose, did what they had to do during the day, and then prepared for sleep as the light left the evening sky. Today, though, we’re staring at strong sources of light well after the sun has set.

The harsh (and oftentimes flickering) light of a television, computer screen, smartphone, and other technological devices fools your body into thinking it’s still the middle of the day. That’s why you need to wean yourself away from these sources of light at least an hour before you intend to sleep, if not longer. If you must work at your computer, I recommend you try a program called F.lux that changes the color temperature of the screen in accordance to the hour of the day.

Don’t Drink and Sleep

As far as sleep tips go, this one is almost counter-intuitive. You’ve likely noticed that consuming alcohol tends to make you drowsy. However, as you close your eyes and drift away, you’re actually getting very little — if any — deep REM (“rapid eye movement”) sleep. That’s the sleep you need to feel rested and refreshed. Think about this the next time you hit up the bar and then crash on a buddy’s couch.

Skip the Midnight Munchies

The digestive processes in your body tend to slow down when you are sleeping, so what happens if you’ve just eaten something before you hit the hay? Your body needs to digest some of that food and those processes can keep you up. Some foods in smaller portions, ironically, can also help you sleep though, like warm milk and whole wheat bread.

Engage in Regular Exercise (But Not at Night)

Part of the key to getting a good night’s sleep is being appropriately worn out when you go to sleep. It also means that your body needs to be ready to go to sleep too. That’s why while you should partake in a regular exercise routine, it’s probably best to exercise in the morning or afternoon rather than at night.

Clear Your Mind

Yes, I realize this is far easier said than done, but a calm brain is one that is more easily lulled to sleep. Speaking for myself, when I need to help myself sleep, I try my best to avoid any sort of late night planning. If I want to plan out my “to-do” list for the next day, I do it earlier the day before rather than right before I go to bed. Leave the office concerns at the office and let your brain rest when you get home.

Be Consistent with Your Schedule

Of all the sleep tips on this list, this one is probably the most important. Your body (and brain) need to recognize a regular routine and schedule when it comes to sleep. If you go to bed at 10pm one night, 3am the next night, and 1am the night after that, your sleeping rhythms are thrown all out of whack. Be as consistent as possible, and this includes weekends.

Consider Buying a New Mattress

Sometimes, sleep problems have less to do with you and more to do with the environment. Your sleep needs to be comfortable and this just isn’t possible with a lumpy and warped mattress. Assuming it gets regular use, most mattresses last about five to seven years. If you can’t get comfortable, maybe it’s time to invest in a new mattress.

Keep the Room Nice and Dark

Getting back to light and the evolution thing, your bedroom should be dark when you are sleeping. This is just like when you place a cover over a birdcage. The bird thinks it’s night, so it sleeps (hopefully). For humans, this means having opaque curtains with minimal light leakage. If it’s really dark, you’ll likely sleep better.

Moderate the Temperature

A dark room is good, but it’s also about keeping the right temperature. A room that’s too hot will have you sweaty and uncomfortable. A room that’s too cold will have you shivering and unable to relax. Most people enjoy the best sleep with a room that is just a touch on the cool side: about 65F or 18C. Your own body heat, coupled with a suitable comforter or duvet, brings that to the perfect resting temperature for nice, deep sleep.

Master the Midday Power Nap

Not getting enough sleep at night and waking up feeling as groggy as ever? Well, naps aren’t just for the kids in kindergarten. In fact, power naps can do you a heck of a lot of good, so long as you don’t overdo them. Master the brief power nap in the middle of the day and you’ll have enough energy to survive the afternoon ‘blahs’ while not being so rested that you can’t get to sleep when it’s time for bed.

Ease into the Nighttime Routine

This is related to the exercise tip described above. You don’t want to go from a moderately high level of activity to hitting the sack in the blink of an eye. This includes both physical and mental activity. Allow your body and mind to slow down as you prepare for sleep. Don’t do anything too strenuous before going to bed.

Pop Some Melatonin Pills

As far as sleep tips go, this is really one of your last resorts. If the above pointers don’t seem to be working, you can take some over-the-counter melatonin. This is a chemical compound that is naturally produced by your body and its purpose is to get you to sleep. The pills can supplement your system and even encourage it to produce more. It’s not a “drug,” but you should still use melatonin with discretion and in moderation.

A freelance writer and professional blogger based out of Vancouver, Canada, Michael Kwan focuses primarily in the areas of consumer electronics, entrepreneurship, and personal development. He blogs six times a week at Beyond the Rhetoric. Follow him on Twitter: @michaelkwan