you need to 1st follow sleep hygiene. You can browse in net and you can see the steps of sleep hygiene and ensure that you are following the same. Melatonin helps in only my sleep related problems like circadian rhythm sleep disorders. If you continue to have reduced the sleep, lack of refreshing sleep, poor quality of sleep then you need to consult a psychiatrist and take medications which will act on serotonin or dopamine in the mind and which will help you to achieve the same. Good luck.
Next Steps
Consultant , attitude Psychiatrist, online or in person immediately