Melatonin

Has anyone used melatonin in their toddlers? My son is 2 and has trouble sleeping sometimes I would just give it on occasion on the nights he has trouble. How much should I give and it be safe?