I experience it sometimes and I'm sure others do too, it can't be fixed entirely but if you wake up, get a drink and maybe just focus on breathing even if your breathing's okay, it'll help handle it, and maybe if you want to just lie down or sit up on some pillows or something comfortable to lean on, a little light on might help as well, It can help sometimes but not always.
A lot of other people experience this, you are not the only one. This can be fixed by finding coping skills that can get you through it, and possibly going to a doctor to maybe see if it can be treated any other way. Finding a healthy, safe coping skill is always a good idea too. Whenever you wake up and realize it’s happening, doing something to calm you down or get your mind off of it can be a good thing to do so you can get yourself better at the time. Talking to someone to is a good thing too.