Sleep issues

E

So, I’ve googled what has been happening when I go to sleep... I wake up suddenly with my heart racing , like in a panic .“Nocturnal panic attacks” is what came up, sounds about right. Anybody have an explanation for why this happens? Anxiety related maybe??