Fall in sleep automatically anywhere is dangerous things,don’t get fall in sleep anywhere.
But when you are in bed and sleep is not coming then it is very dangerous.
The most common factor is unwanted things comes up in your mind and your mind Get engage with these type of thinking and sleep Get away.
To avoid such type of things, go to your bed timely and do breathing exercise take a deep breath and release again do same until you not get sleep. I am sure after 10 to 15 breathing exercise you will get sleep hundred percent .It is a type of meditation also