My nightmares largely stopped after being awake tired af and terrified of sleeping, when I said "damn you nightmares, you can't scare me into sleep deprivation! I'm coming in there and I'm gonna fight back", and then went right back to sleep. I don't know what nightmare I had that drove me to get angry at my nightmares, I didn't even have a plan to fight back. But that's when it stopped, when I stopped being afraid of them.