We all have had, do have and will have nightmares. They can be provoked by illness, worry, concern...things that are no longer important when you wake up.
But for our children a bad dream can be an exaggeration of their fears. It's happened to us as well: when we are small we dream that there is a monster in the wardrobe and on waking up we believe that this monster really could be hidden amongst our clothes. By saying this we want to point out that anxiety provoked by a nightmare is as intense for the child as it is for us, ones that are provoked by a problem or a terrible occurrence.
With this in mind we have to act: it isn't enough to say "are you scared by something as silly as a nightmare?" You have to comfort them and play it down, chat with a soft and tranquil tone in order to assure them that they have nothing to be scared of. If it's about something specific, ask them to tell you about the nightmare because very often the mere act of describing your fear to a protective adult will comfort them.
Little by little sleepiness will return: you can calm them down by telling them a story, talking about how fun it is to dream, saying that a nightmare can never be followed by another one or by exaggerating that, whatever happens, you will be in the room next to them. In any case it is fundamental that you stay with them until they fall back to sleep.
The most important thing is to ensure that they do not feel alone. A simple but very efficient way of achieving this is to provide the child with a "sleep" companion: a simple cuddly toy that they can cuddle while sleeping. There's no need to explain why this is so effective: we have all had a teddy bear or a toy penguin or dog that has accompanied us on our best nights sleep and protected us from nightmares.
To conclude: you have to be comprehensive, to understand that anyone can have a good night and believe that there is no place where you feel as safe as you do in your own home.