WESTPORT — Ever since my teenage years, I have not been a restful sleeper. I grind my teeth, toss and turn, and often wake up shrieking in a habit my childhood pediatrician officially diagnosed as “night terrors.”

Despite my exorcism-like sleep patterns I, for the most part, wake up each morning believing I’ve received eight hours of good rest. A few months ago, however, I experienced a rough patch in my sleep in which I had difficulty falling asleep and often woke up in the middle of the night and could not fall back asleep.

In response to hearing about my sleep woes, a medically minded friend asked if I practiced good “sleep hygiene,” a word that immediately brought to mind the image of a pubescent teenage boy who doesn’t shower. But according to the Division of Sleep Medicine at Harvard Medical School, it actually means a variety of practices and habits that can help people maximize the hours they spend sleeping.

Upon reflection, I realized I did not, in fact, practice good sleep hygiene, especially when it came to establishing a healthy and routine nighttime ritual. Most nights before bed, I’d scroll through Twitter, scan the news of the day and leave my phone either directly on my bed or on the floor next to it. Because I have a semi-erratic reporting schedule and arrive home at varying hours of the night, I’d plop into bed at a different time each day unaware of my bedtime.

Over the past few months, I’ve taken steps to improve my sleep hygiene and, consequently, my ability to fall asleep and stay asleep has much improved. Instead of Twitter, I now opt for a short period of reading, particularly books that don’t provoke any emotional issues to surface, before bed. Additionally, I try and go to bed at the same time each night. Instead of keeping my phone attached to me, I now place it across the room, which at first felt like ripping an extra organ from my body, but now provides the distance necessary to separate myself from the stimulation of the day.

“All people should have a bedtime ritual, but everyone’s can be different,” said Dr. Stasia Wieber, a sleep expert with the Yale New Haven Health Northeast Medical Group Sleep Center in Fairfield. Showers, meditation and deep breathing are some of the winding-down activities Wieber recommends to patients, but urged people find a routine that works for them and stick to it each night. A comfortable, moderate room temperature — around 65 degrees — and limited light exposure at night are also helpful for good rest, Wieber said, adding that light decreases the release of melatonin, which makes it harder to sleep.

While it’s beneficial to try out different sleep hygiene tactics on your own, Wieber said many patients who suffer from sleep disorders don’t seek medical advice. That advice can be helpful if, like in many health topics, it’s difficult to tackle it alone.

svaughan@hearstmediact.com; 203-842-2638; @SophieCVaughan1