Melatonin is a hormone that our bodies naturally produce to prepare for bed, and you can also find it in supplement form. While health experts say that melatonin supplements can be helpful for quickly adjusting to a new sleep-wake schedule (like when you’re traveling to a new time zone), most caution against long-term use.

That’s because taking melatonin nightly—especially in doses higher than 0.5 to 1 milligram at a time—can potentially cause unpleasant side effects, downregulate your natural production of melatonin, interfere with certain medications, and, not to mention, prove ineffective at improving sleep quality.

“The evidence for melatonin use for falling asleep more quickly, staying asleep longer, and for sleep efficiency (how much of the time you are in bed you are actually sleeping) is weak, and as such melatonin is not recommended for any of these purposes,” says Ellen Wermter, FNP-BC, a family nurse practitioner and spokesperson for the Better Sleep Council. So if you’ve gotten into a routine of taking melatonin before bed, here’s how to kick the habit.

How to get high-quality sleep without supplemental melatonin.

First and foremost, if you’re taking a high dose of melatonin nightly and are looking to stop, you should consult with your doctor to be safe. They’ll be able to recommend the best course of action given your health history and any existing medications.

With that being said, most people should have no problem giving up melatonin in one fell swoop as there’s little evidence that it is habit forming. Others may have better luck gradually taking a lower and lower dose as the days go on—again, as overseen by a doctor.

Either way, you’ll want to make sure your sleep hygiene is in good shape as you’re transitioning away from melatonin supplements. By keeping your bedtime routine consistent, you’ll help support your body’s natural production of the hormone.

“The most important adjustments you can make include stopping all screens (TV, too!) two hours before bed, and dimming your household lights in the evening to help your pineal gland begin to release melatonin ahead of bedtime,” says Laura Erlich, LAc, FABORM, a fertility and obstetric specialist and founder of Mother Nurture Wellness. Once the lights are low, get into the habit of completing a relaxing, no-tech wind-down routine. It might include sipping herbal tea, taking a hot bath or shower, or reading a physical book.

Waking up at the same time every morning and getting outside for some morning sun can also help keep your natural levels of the hormone regular. “Avoid changing up your bedtime and wake time,” advises Christina Graham, a registered nurse and Noom coach. “Our internal clock craves consistency, so sticking to the same schedule, even on the weekends, is key for supporting consistent sleep.”

Once getting into the groove of this routine, most people will find it a lot easier to both fall asleep quickly and stay asleep through the night. However, if you still feel like you’re missing out on melatonin, the issue could be a psychological one. “It may take the person some time to uncouple the idea of ‘taking a pill’ with sleep,” says Wermter.

In this case, Revée Barbour, N.D., M.S., naturopathic doctor and owner of Dr. Ray, N.D., notes that other forms of natural sleep support can be helpful. (Here are some other nonhormonal supplement options to look into.)

But at the end of the day, Barbour says, the best way to improve your sleep is to get to the root of what’s keeping you awake. Are you eating too close to bedtime? Consuming a lot of caffeine? Stressing too much and not moving enough during the day? These are all habits that will really disrupt your sleep quality but, on the other hand, can dramatically improve your sleep when addressed.

Melatonin supplements can be helpful for encouraging the body to adjust to a new bedtime, but they are not intended to be taken as nightly sleep aids. (Hence why they’re pretty tightly regulated in most countries.) If you’ve gotten into the habit of taking melatonin nightly and want to stop, consult with your doctor and be sure to commit to a consistent bedtime, nightly routine, and wake-up time to help your body get back to great sleep, naturally.

If you are pregnant, breastfeeding, or taking medications, consult with your doctor before starting a supplement routine. It is always optimal to consult with a health care provider when considering what supplements are right for you.