i have a similar problem but what i do is i remain calm and don't panic it makes things worst i try to move the smaller parts of my body like fingers and toes and eyelids they are the easiest body parts to control the reason is because even though you mind is awake the nerves around your body are still asleep and so when you send the message they to transmit it to the muscle so it is like waking up some one who i a persistent sleeper you got to keep yelling at them figuratively so keep trying and it should eventually wake the rest of your body
Do you mean like you awaken from a dream but your body remains paralyzed? Thats happens to me it is horrifying and very stressing it is called hypnogogia. The way you can try is to try swallowing so you cam wake up. Or if its just a lucid dream tell yourself time to get up.