You, as the parent, make sure the child is currently safe, then give yourself a timeout. No joke! It’s incredibly difficult to destress with an infant around. The moment you are at all tempted by ideas like dosing your kid, it’s time to step away - isolate yourself, recenter, and try a better approach (even if it’s the hundreth time).
Anyway, I’ve seen multiple statements by qualified professionals about melatonin not being safe for kids. Unless you have sources to back your claim, I completely reject it. That’s just the way it works…