Laryngospasm; the cause is usually damage and sometimes can be completely reversed. It seems to be a overactive reflex to prevent drowning.
This happened to me last night, and has happened about 4X in the last 2yrs (roughly). In the middle of a sound sleep, my body rises as if the bed is on fire, I sit up straight, and start gasping as if I have seconds to live. I suck air in as rapidly as possible. It’s not pretty. I make a lot of horrifying sounds, and continue doing so until the faintest burp leaves my lips. And I continue to to release these “baby burps” until I can speak. As soon as I gain composure, I’ll reach for a sip of water. After I convince my wife that I’ll be ok, I’ll fall right back to sleep, and sleep well at that! It’s scary as all hell. The only thought that runs through my head while that’s happening is that I’m going to die. What on Earth causes this, and how does one make it go away?
I have had the same thing a few times a year, choking on saliva or water, then can’t breathe, gasping for air. What I have found is a condition called laryngospasm, where the larynx closes off, gasping for air. I try to calm myself knowing that once it relaxes it will open, but it lasts for more than 30 seconds and is terrifying! You should Google what to do if it happens, suggesting pressing on an area behind the ear to open the larynx. Also, talk to your doctor. Blessings to you!!