IMO it does depend upon the cause of the nightmare...if you can write them down, even if with flashlight and main word scribbles...to review later, you might see a theme.
If they are drug induced, well, not much you can do but 1) hope they cease after being on the med awhile 2) reduce the strength of the dose 3) quit the med
I agree also with the self talk as you fall asleep...but I think you already have sweet thoughts before bed.
Have you tried lucid dreaming? The more you work on it, the better you become with it. It's a way to "change" the dream while you are still dreaming. Not for amateurs, but exciting when done.
Sweet dreams!