Melatonin is generally considered safe for short-term use to reset a sleep-wake cycle, and most people don't develop dependence on it the way they can with sleep medicines. It works best alongside a fixed bedtime and wake time, not as a long-term fix by itself.
Next Steps
Build a consistent routine alongside it: dim lights and no screens before bed, and the same wake-up time every day. Please check with a physician before continuing it beyond a few weeks.
Health Tips
Stop and see a doctor if it leaves you groggy in the morning or your sleep hasn't improved within a few weeks.