When you’re tossing and turning due to anxiety, jet lag, or loud neighbors, you know you can always count on one thing to doze off: melatonin.

Melatonin is a hormone that helps you fall asleep, says Keri Peterson, MD, an internal medicine physician and WH advisory board member based in New York City. “The pineal gland makes melatonin in response to our circadian rhythm,” she adds. “When it gets dark out, that's a signal to the pineal gland to make melatonin naturally.” Many people also take the supplement to help them fall asleep faster.

Meet the experts: Keri Peterson, MD, is an internal medicine physician and WH advisory board member based in New York City. Leslie Bonci, RD, is a sports dietitian based in Pittsburgh.

But there’s a lot of mixed messaging around melatonin, specifically around how well it works, whether it’s addictive, and whether you should rely on it. Ahead, find out what the science really says about melatonin—and who can stand to benefit from taking the supplement.

The Truth About Melatonin

There are a ton of misconceptions about melatonin—like the expectation that you’ll instantly fall and stay asleep after taking it. However, “it doesn't work for everybody,” especially the first time you take it, says Leslie Bonci, RD, a sports dietitian based in Pittsburgh. You may have to take it for a couple of weeks to see if it works for you. And if (and when) it does, “maybe you'll stay asleep longer, but that doesn't guarantee eight hours of uninterrupted sleep,” says Bonci. Other misconceptions may come from people using melatonin incorrectly, like taking it too close to bed and not feeling the effects until a lot later.

To set the record straight: Melatonin is super safe to take, and it’s not addictive. Still, experts don’t recommend relying on it. “Melatonin is a crutch,” says Dr. Peterson. “It prevents you from learning the skill of falling asleep on your own,” she adds. So, it should be your last resort if you want to improve your sleep. You should still practice good sleep hygiene, including sleeping in a dark, cold room with blackout shades, a sound machine, and maybe even with a weighted blanket. You should also stop eating three hours before bed, exercise no sooner than one to two hours before, and cut out caffeine after 1 p.m, Bonci adds.

Plus, while melatonin doesn’t necessarily become less effective over time, the body grows accustomed to it, says Bonci. So, that’s another reason why it’s better to save it for times of need (rather than every day), like if you’re traveling through different time zones and “your sleep cycle gets somewhat disrupted,” she adds.

How to Start Taking Melatonin

Before taking any supplement, you should always chat with your healthcare provider. But that’s especially true if you have any health conditions associated with hormones, like diabetes or thyroid issues, since melatonin is a hormone. In those cases, it’s imperative that you talk to a doctor to see if there could be any interactions with medications or your diet, says Bonci. Additionally, pregnant women and those under 18 shouldn’t take melatonin because the data is too limited, says Dr. Peterson.

Then, consider your general sleep hygiene, says Bonci. If you think you’re doing everything right, then you can try melatonin. (With good sleep habits, you’ll likely have a better response to the supplement than if you, say, drank a cup of coffee before bed then popped a capsule, she adds.)

Start with a dosage of 0.5 milligrams taken about one to two hours before bed, Dr. Peterson says. If after a month, it’s not making much of a difference, try doubling up the dose. Just don’t go above 5 mg, as doses higher than that haven’t proven to be more effective and actually may be more likely to cause side effects like headaches, dizziness, and drowsiness, says Dr. Peterson. If you’re experiencing any of those side effects, just lower the dose, she adds.

The Best Sources of Melatonin

To find a good melatonin supplement (or any supplement for that matter), scan the label to make sure it’s third-party tested for safety. That’ll ensure it contains everything it says it does, and nothing that it doesn’t, says Bonci. Additionally, it’s best to avoid proprietary blends like “sleep cocktail” powders. “Chances are, there's got to be a pretty small amount of melatonin and large amounts of who knows what,” she says. Also, there are natural sources of melatonin that you can consume before bed, such as tart cherry juice and walnuts, Bonci adds.

It can feel frustrating when you’re seemingly doing everything “right” with your sleep practices, but you just can’t fall asleep in a timely manner. When you’re in need of a little help, it’s okay to lean on your friend melatonin—as long as you save it for challenging sleep situations.