Shaykh Ibn al-Uthaymeen was asked, what are the conditions in which a Jinn can possess a child, so he explained in the following way.
Some of the foolish, ignorant people, lacking intelligence, scare their small innocent children and frighten them by saying: so-and-so (monster) will come (and take you), or so-and-so (demon) will (do such-and-such to you).
So the child gets scared and this fear and anxiety remains in his heart, and this becomes permanent in his heart so that he is constantly in anxiety, fear, and distressed.
Sometimes it is the father who scares his son and sometimes it is the mother who scares her son or daughter.
But the most foolish ones are those who tell us that when a child does something wrong (then as punishment) he should be locked inside his room, alone.
They do not feel sorry for him even when he shouts and screams nor do they open the door. And this is one of the means by which a Jinn overpowers (and possesses) the child.
This was conveyed by one of the Jinns who had possessed a child and said that he entered in him when his father had locked him inside the room, and he began to shout and scream, and that’s when he possessed him.
So we should be alert and take precautions from the things which can become a means for the Jinn to overpower us.”
Article taken from Ilm4all Facebook page, with reference to Bayan Haqeeqatul-Sara’al Jinn Lil-ins.