It could be God telling you to awake, could be demons, or could just be something irregular or out of balance in your body. It could also be the fact that a child is in your bed and your subconscious is trying to warn you or has a thought in it regarding that. You could have eaten something before bed that is triggering a response when it finally digests or settles, you could have been on an electronic before bed and your mind is somewhat still readjusting. Perhaps it’s something in the air or temperature. There’s lots of scientific/bodily reasons this could be happening.
I would say not to dwell on demonic things and instead pray some Hail Mary’s until you fall asleep, or because it is 3am (I’ve heard it can be done especially at 3am and pm) say a Chaplet of Divine Mercy until you fall asleep or finish it.
If you feel seriously unsafe, ask God and your Guardian Angel’s protection and say “In the Most Holy Name of Jesus, Satan be gone” (I’ve done this when I was afraid and it really helped just knowing Jesus is by my side and He is powerful through the Father!), Signs of the Cross Work too. If these thoughts of demonic activity keep occuring, seek guidance from a priest.
God Bless!