I was using melatonin for about a week and it stopped working. I increased the dose and it worked for another 3 days or so... then made no difference. At least it only cost a few bucks for 10 days of good sleep. I found it hard to get up in the morning though. Also, I was groggy all day.
I don't know for sure, I just know I was adding too much to my self-made turmeric pills at one point, and it lead to really terrible nausea and vomiting. It took me a while to realize that was this issue.
I try to prioritize why i can't sleep. Usually has to do with a big event coming up or some minor stressors building up and compounding. So i try to analyze them for a bit to try to minimize the anxiety.