Melatonin is produced by the pineal gland. It regulates the circadian rhythm and thus sleep.
Try making sure there is no light in your bedroom and no EMF’s from devices when sleeping.
Keep the bedroom just for sleeping both cool and dark.
Try all the natural ways to boost your levels of melatonin before trying a supplement.
Excellent advice as always.