No. I've taken melatonin in the past and I don't know if it worked or it was just placebo because I changed also some habits like not going to bed with my tablet to watch Youtube. After taking the pill I didn't stare at any screen and I kept the lights as low as possible to help my body produce more melatonin.
Some "rituals" before sleeping are helpful too, like turning every thing off and drinking a cup of linden tea or valerian tea and then going to bed. Even a rooibos or anything without caffeine works, the important part is the ritual where you relax and prepare your body for the night.
In addition to that I found out that a little bit of intensive workout helps a lot. You don't need a 10km run or to light weights for 2 hours. Just put some tension into your body. You can't do a push up? Do half and stay there hanging with some tension on your muscles. Stretch your body until you feel the burn for a while, specially legs and back. There are some yoga posses where you stretch and also use your strength and they don't require any experience. And of course, don't hurt yourself doing more than what your body can take.