I have taken melatonin for the last 20 years, and with no problems. I think that it might sometimes cause more vivid dreams, but as long as I am not having a nightmare, that is not a problem for me.
Melatonin is a natural hormone that our bodies all produce, not just people, but also most animals. It usually starts working when it gets around twilight, so that people/animals would be sleepy by nighttime.
Mothers also produce it in their milk, and it helps the baby/animal to sleep better.
As we get older, our body produces less and less of this hormone, but it is also an anti-aging hormone, and has other benefits for our body and our health.
There is a book called “The Melatonin Miracle” that totally explains all of the benefits of melatonin. Like many other things, some people require more and some require less of this hormone, probably also depending on your age, as well as how much your body naturally makes on its own, and maybe even how much light you have on in your house at night, since light inhibits melatonin.
I started out with 3 mg after I read the book, mostly because I wanted the anti-aging and health benefits, as well as the sleep.
I gradually increased the amount that I take over the years, and I now take 10 mg about a half hour before i go to bed at night, and then I usually fall right asleep when I go to bed.
I think that it is mostly a matter of balancing the amount you need to help you fall asleep, with not having more vivid dreams than you want to have.
I also take magnesium, and it helps you to sleep better, too, although I take it to help keep my heart in the right sinus rhythm.