There’s lots of anecdotal evidence that melatonin supplements help some people sleep but not others. There’s also much debate about the proper dose and timing.
For one thing, the amount of melatonin the body produces is miniscule compared with commercial dosages. For another, there’s strong evidence that morning exposure to sunlight leads to a melatonin spike the same evening.
Here are some links that will help you think about how to structure a self-experiment with melatonin.