I get that sort of thing when I am really tired, and it seems to happen more often during naps, or in the morning when waking. All I can say is, try to get more sleep so you aren't exhausted and you might have them less. Also relax about it, and instead of trying to wake up try to go back to sleep. When I do that I find it easier to wake up. It's hard not to panic during it, but you are safe and it is okay.