Melatonin isn't really considered to be a sleeping pill and not classed as a medication.
But instead Melatonin is basically a hormone that our bodies are supposed to naturally produce and release during sleep but sometimes out bodies don't produce or release the required Melatonin to help us sleep.
So instead sometimes people need to take a Melatonin pill to help them sleep and sometimes it will help them sleep.
If not you may need to get a prescription sleeping pill like Ambien or other sleeping pills or even try some over the counter sleep aids.
Just be careful when taking sleeping pills and make sure you have enough time to lay in bed to get the required sleep before waking up and driving or operating machinery.