Here are several ways you can try to prevent nightmares from happening:
Make stories and quiet songs part of your bedtime routine, but make sure the topics are not scary.
If your child is afraid of monsters, try talking to him about how to solve that problem. Together with your child, jointly inspect under the bed and in the closet to make sure there are no monsters present.
Let your child sleep with a night light and the door open as wide as she wants.
Always tell your child you're right down the hall, and will make sure that he is safe all night long.