It's an artform, like perfectly baking a poo. If you time it right you can basically fall straight asleep without your brain going "hey, I just thought of something!"
I messed up last night when I hit the wall after 9 days solidly on the go - I thought the bed looked nice and a little lie on it wouldn't hurt but I still had shit to do before bed. So I dropped off but my brain kept prodding me back to near consciousness and I kept on having weird sleep paralysis/false awakening dreams - including one in which I heard a woman murder a friend outside my bedroom door but I couldn't force myself off the bed to intervene.