When I was suffering from this several times over the last two years it was scary as hell. And that's why I just wanted to chime in to share my experience getting over it, which happily I was able to do.
The worst thing you can read is that maybe you have "central sleep apnea" and that your brain is somehow broken and not sending the appropriate breathing signals to your lungs. Happily, I found this was not at all the case and that this possibility is indeed an unlikely scenario.
Like a lot of people here, I would be drifting off to sleep and then suddenly jerk awake feeling that I wasn't breathing. First things first, I have had several experiences in my childhood where I was either actually near drowning or choking on something, so breathing has always been on some subconscious level for me associated with a bit of fear. It came to a head when other lifestyle factors compounded my overall anxiety in my adult life (I am now 42) and this sleep onset apnea began occurring. I can't say for certain it was the driver, but this transitional apnea only ever occurred after having experimented with cannabis (for anxiety). I had never smoked, and I think on some level the awareness that had grown of my lungs (because smoke irritates them -- I had never smoked before) was contributing to my breathing anxiety, which I believe spilled over into more generalized anxiety, which again compounded the breathing anxiety. It wasn't pretty.
Let me just say that for the most part I have gotten over both my anxiety and my transitional apnea, and I don't think that's a coincidence, nor impossible to do despite how you may be feeling right now. But I take no medication anymore for anything, no pharmaceuticals, no cannabis, and I drink much less overall and especially before bed. This is significant because I believe the onset apnea is highly linked to the fear of it happening again. Instead of brushing it off I began thinking something was wrong with me. I then began fearing dying in my sleep, "and what about my family", and the rollercoaster began.
One of the things about anxiety is that it's both exasperating because we wrongly believe it is meaningful and indicative of real problems in our lives, but it is also treatable through rational exercise within the mind. The first step I believe is to make changes in your life to reduce anxiety. Maybe slow down the work schedule, tie up some loose ends, put an end to fixable issues that are bothering you (and learn to A.C.T. your way out of the ones you can’t fix), do relaxing things like yoga and stretching, and make it an important focus to learn to breathe properly. There is an amazing book that I chuckle about now because I actually returned the audiobook edition once before finally finishing it a month later. I read about nose breathing and its importance, then went on a ride on my indoor bike trainer, breathing entirely through the nose, and it set off a panic attack that I was suffocating. It was at that point I realized how attached my anxiety had become to my breathing. Several days later I redownloaded the "Breath" book (by James Nestor), and, with several grains of salt, finished it.
After two months of breathing exercises, yoga, stretching, physical exercise (always breathing through the nose), and subsiding almost all possible drugs, I have had only one recurrence of the “jumping up unable to breathe” nighttime scenario, and this occurrence was wholly attributable to a dream I had woken up from where “something was in my throat”. Old fears can die hard, but we don’t have to attribute meaning to them more than they deserve. Using A.C.T, which I have become accustomed to and practice daily, I told myself “I am having a dream that I could not breathe”, then fell back asleep promptly. This is highly different from the thought “I am gasping, what is wrong with me?”. Therein lies the beauty of Acceptance and Commitment Therapy. You learn to live with things and shrug them off, mentally downgrading the importance of things that are bothersome or frightening, never running away from them which legitimizes and "upgrades" them. I highly recommend “The Happiness Trap” by Russ Harris. Practice this daily and you will very likely see gradual improvement.
Breathing exercises were even more important however, I believe. Please read “Breath” by James Nestor and practice the exercises in the book. What I found was that I had a very low tolerance for CO2 in my bloodstream. This is one of the only other factors in the human mind outside of the amygdala response that can cause true panic. And I believe it is highly linked to why we can wake up gasping, as well as being on edge the entirety of the day feeling like the world is ending – your brain erroneously can believe you are “out of air” when you are most definitely not. Breathing harder and faster throughout the day makes it worse, not better, expelling too much CO2 and altering for the worse your blood chemistry and CO2 tolerance. You must slow your breathing, especially your exhalation.
In short, the brain stem receptors that tell your lungs to work are guided by CO2 concentrations in the blood, not O2 which they are completely blind to. The good news is that it is highly unlikely you are actually short of air, but your mind may believe you are. This is trainable, and I have been doing it successfully. Using the Wim Hof method I, daily, at least twice a day, breathe in and exhale 10 large, full, fairly fast breaths, entirely through the nose to inhale, out of the mouth to exhale, then I exhale one more time and hold my breath for as long as I can. Two months ago I could only do this for 30 seconds before the lungs said “Breathe!!!” then forced me to do so. Two months later I have gradually worked up to 2 full minutes, holding my breath on empty lungs. It has been a game changer. Slowly training breathing through my nose on the exercise bike at higher and higher levels has taught me that it is a snap to do it all day. When I first began, it literally caused a panic attack. Then I could only do it to about 120 heart rate before I felt suffocated. Then I learned to breathe slowly but fully through the nose, not quickly and shallowly as we tend to do through the mouth. I get big, full respirations through the nose now, and I can do this up to near maximum heart rate of about 165bpm (max is around 178bpm for me, and I hope to train up to this point as well, taking my time). My sinuses are almost always clear now, my lungs stronger (breathing fully through the nose tones the diaphragm, which brings breathing confidence which is the opposite of breathing anxiety), and anxiety has almost completely disappeared – something I have battled much of my adult life.
I don't know what else I can add. It was scary as hell, living through the experience, which was on and off over some two years. I just want people to know what it was for me, and what it might be for them. Doctors don't seem to be more than pill pushers these days, and I don't blame them -- who actually follows lifestyle change advice? Well, I set out to beat this problem and I feel like a new person and I hope you can too. I wish you all well on your journey to feeling better.