Melatonin for 3 year old

Guys, when is it okay to give your little one melatonin? My daughter was up from 1 am to 4 am last night and she’s killing me! Wondering if it’s okay to give her melatonin on nights like these.