Many scientific studies have suggested that taking melatonin tablets can induce sleep  But this does not mean that melatonin is helpful in treating insomnia
Most of the studies examined only people without insomnia, and in many of the studies, only a few of the subjects given melatonin appeared to be significantly affected by it
If melatonin were helpful in treating insomnia, then every person with insomnia who took doses of melatonin would appear to be significantly affected by it.