Sleeping troubles!!!

So just recently my 3 year old has been having trouble getting to sleep. She will just lay in bed for a few hours then want to come to our bed and then will stay awake in there for another hour or so. I’ve always been against using melatonin to help but I’ve been considering it.. Has anyone used it? I hate the thought of giving her something to make her sleepy but I’m worried she’s not getting enough sleep.