How do I stop my nightmares?

I have been having a lot of nightmares where I am being killed in different ways. I either wake up in a panic or just crying and sweating. It has made me terrified of falling asleep and is now affecting my daily life too. Can I make the nightmares stop?