Hi Rachel,
This affects 2-5% of the general population - including me.
I know it's scary but it's completely harmless and you won't die. I've had it for 50 years and I'm still going strong!
It's due to a very minor brain glitch. As you probably know, we alternate between REM (dreaming) and non-REM sleep throughout the night. REM stands for the rapid eye movements we all make when we're dreaming, btw. During REM sleep the brain secretes a hormone that paralyses all our voluntary muscles, to stop us jumping up and acting out our dreams. In some individuals, the brain continues to secrete this hormone for a few seconds after waking, or may even start to secrete it just before the individual falls asleep. Hence the experience of waking to find yourself completely paralysed.
The feeling you can't breathe is because all your voluntary muscles are paralysed - as you've obviously noticed. When we're awake we use two different mechanisms to breathe. The autonomic nervous system works without conscious intervention throughout the day and night to keep us breathing using the diaphragm. However, during waking life we also have some conscious input to breathing. You've probably noticed you sometimes take an extra-deep breath. For this, we use our voluntary muscles. These aren't available during sleep paralysis, which means it can feel as if we can't breathe, when in fact our automatic breathing is still going on.
I know it's tempting to try and kick out violently to break out of it, but this may even prolong the experience. I try to concentrate on moving either the tip of my tongue or the last joints of my fingers.
It's more to the point to try and stop it happening in the first place. Most people can dramatically reduce the frequency of attacks by identifying - and then avoiding - their triggers. These vary from one person to another, so you'll need to keep some kind of journal to try and identify yours.
My own main trigger is getting too warm in the night - and this seems to be the case for a lot of sufferers. However, I have heard reports that some people have attacks when they get too cold! Another one for me is sleeping too much. I'm far more likely to have an attack when sleeping in or taking an afternoon nap. But there again, some people have more attacks when they're not sleeping enough. Different foods or drinks can have an effect on some people. You might need to look at what you're eating or drinking in the evening in relation to attacks, as well as evening activities. Orientation of the bed can have an effect on some people, as well as sleeping too close to something like an electrical switching device or a wifi hub. This isn't suprising, as the brain works via its own internal electrical signals. And of course, stress and anxiety are major triggers for all of us - especially anxiety over having another attack!
The thing to remember is that your brain won't let you die during an attack. There are all sorts of failsafe systems in place that will bring you out of it in a matter of seconds (even if it feels like hours!)
As a last resort, you can ask your doctor to put you on one of the older antidepressants of the tricyclic class (like nortriptyline or amitriptyline) as these completely suppress REM sleep, thus solving the problem. However, they don't cure the condition. As soon as you stop taking them, REM sleep will be restored, together with the sleep paralysis. And they're not without side-effects, so you might want to consider whether you want to be on medication for the rest of your life. There's also a problem in that most doctors (especially GPs) know little or nothing about sleep disorders and may prescribe one of the more modern SSRI antidepressants. Although these may control sleep paralysis, in some patients they cause the side-effect of very disturbing nightmares, which would be substituting one problem for another!
I would stress, however, that sleep paralysis isn't a symptom of depression. The effect of tricyclic antidepressants on REM sleep is just a spin-off.
There's one bit of good news though. The frequency of attacks declines with age. I suspect you're still very young, so that won't be too much comfort to you though! In my case, it started in my early 20s and started to decline as I went through my 30s, before falling off much more sharply after the menopause. However, you'll also find the frequency of attacks goes down once you get less anxious about it and start feeling more in charge. Identifying your triggers will help this process.