It sounds like the most likely thing here is that you are suffering from sleep paralysis. This is a condition in which the physiologic adaptations to deep dreaming sleep, which include complete relaxation of all of the muscles of the body, do not "turn off" prior to awakening. This is very terrifying, because the sensation is exactly that of not being able to move at all! However, generally speaking, the symptoms resolve on their own after a few seconds.
In mild cases of sleep paralysis, usually it is enough just to know what is going on and that the condition is relatively benign and not something to be scared by. However, more persistent and severe cases should be investigated by a
sleep doctor. This is because, sometimes, the condition is associated with narcolepsy or other sleep conditions which can be effectively treated. Also, occasionally, isolated severe sleep paralysis can be treated with medications, although the downside of treatment is that it involves suppression of deep dreaming sleep.
You should start with a thorough medical check up by your
primary care doctor. If they feel it is necessary, they can make the referral to a
sleep specialist for you.
Good luck!