it's called sleep paralysis and is indeed a very strange state. most of the time you have opened your eyes, cannot move and sometimes even hallucinate the wildest things while being conscious about your surroundings. the best thing to avoid sleep paralysis ime is having a regular sleeping pattern (something that society makes really hard for me) while an almost sure way to induce it every night are those malaria prophylaxis tabs you should take in certain places with extra high risk. it used to totally freak me out (partly because of the hallucinations; i've had a speaker in my field of view turn into the grim reaper once ), but if you know the state well enough to recognize it, it's more interesting than scary. and indeed moving the fingers fist helps