Nightmares are just intrusive thoughts and feelings passing in the night. As with any passing intrusive thoughts and feelings (daydreams, flashbacks, nightmares, and so on) there are three things we need to do.
First, when we become aware intrusive thoughts and feelings are passing, we need to ground ourself and assure ourselves we are in fact safe. So when I wake up about to scream (become aware) I look through the image in front of me (the intrusive image) at the physical reality of my bedroom; the bed, the pillows, the windows, my spouse, everything in no particular order. I remind myself I am not in the combat zone (or other traumatic setting real or imagined), that I am warm and dry and safe in my comfortable bed. I remind myself it was just the passing intrusive thoughts and feelings that woke me, old stuff, not a real threat in my current situation.
Secondly, I focus on my behavior in my current situation. At night my current need is to sleep. I return to my favorite sleep position, refocus on the physical comfort of my bed and (hopefully) drift back to sleep. If my focus won't shift, if the intrusive thoughts and feelings are racing, I settle for the next best thing. I remain in my favorite sleep position and take deep, abdominal breaths while the intrusive thoughts and feelings whirl around, letting my body rest.
And third I share the intrusive thoughts and feelings (those I remember) with my therapist in individual sessions, exploring them and beginning the process of reframing them and pursuing the therapeutic process of understanding and deintensifying that particular set of intrusive thoughts and feelings. The act of deciding to make that set of intrusive thoughts and feelings a topic at my next regularly scheduled therapy session gives me the feeling I am in control of them, rather than the feeling they are in control of me. If the set persist in intruding, I make notes for the next therapy session.
Ted