First of all buy yourself high-quality CO2 meter for ~$100 and make sure that CO2 not going over 1000 PPM while you sleeping. Every single time I sleep in closed room with bad ventilation where CO2 getting over 1200-1500 PPM I will wake up in terror. You can't imagine how many people I knew had terrible quality of sleep due to bad ventilaton and never realise it.
Second thing if nothing else works. Try strictly-scientific lucid dreaming practices: record as much of dreams is possible in a diary for several months, do deep breathing before sleep, etc. Looking at your hands every now and then is required and slightly weird, but it totally worth it. Once you get lucid in a dream once and preserve memory of it will become much easier to deal with nightmares.
Lucid dreaming cost nothing even though some REM sleep tracker like one in Apple Watch is useful. Though beware of bullshit.