There are 3 keys to writing good dialogue in a novel...
Giving dialogue a purpose means that every line of conversation in your novel must be there for a reason. If the speeches in the novel don't meet at least one of the following three criteria, they should be cut.
Conversations in the real world often have little or no point to them, with the circumstances of the people involved remaining unchanged.
Writing good dialogue, however, means that a conversation in a novel should advance the plot in some way.
How do you know if dialogue moves the novel's plot forward? Ask yourself these questions:
Will the story still make sense if the dialogue is removed? If it can be removed without leaving a missing link in the character's journey towards his or her goal, scrap it.
Does the dialogue increase the suspense for what is to come? If a character says something which causes the reader to worry about the nature or the outcome of an upcoming event, it should stay.
Does the dialogue change the character's situation, for better or worse? Do they receive some good or bad information which leaves them closer to their goal or further away from it? If so, it is moving the plot forward.
Does the dialogue shed some light on what the character wants? Anything which makes a character's goal clearer is good and should remain - as should anything which makes their motives (or why they want to achieve their goal) clearer.
Does the dialogue serve to strengthen the character's resolve, or perhaps weaken it? Are they told something which makes them wish they hadn't bothered to achieve their goal in the first place - or make them glad that they did? Either one is good.
I am sure there are plenty of other questions, but they give you the idea. If a conversation is some way related to a character's goals and conflicts (which you can read about in the section on How to Plot a Novel), it can be said to be moving the plot forward.
If the characters are talking about nothing important, it is filler and should be removed.
It should be noted, though, that some pointless conversation in a novel is good. Writing good dialogue also means keeping it authentic, and we all talk about the weather or what we would like for dinner.
Keep the chit-chat to a minimum, though. And always ensure that if a passage of dialogue starts out being about nothing of any importance, it quickly gets to the point.
"The dialogue is generally the most agreeable part of a novel, but it is only so long as it tends in some way to the telling of the main story."
- Anthony Trollope
Just as advancing the plot is one way of writing good dialogue with purpose, so too is adding to the readers' understanding of character.
So maybe the speaking character tells whoever is listening about a formative event from their childhood, or about their love for their family, or about their dreams for the future.
These revelations might not affect the plot, might not be important for the telling of the story - but they help to explain the character's motivation for wanting whatever it is they want - and doing that helps us to get to know them a little better.
(Again, you will find all the information you need on the whole business of getting to know your story people in the section on Creating Characters.)
Finally on the subject of writing good dialogue that characterizes, understand that dialogue is the most important tool in demonstrating the relationships between different characters.
The way two people speak to each other tells you virtually everything there is to know about how they get along. And demonstrating this to the readers, particularly the relationships between the major players in the novel, certainly gives dialogue a purpose.
What kind of information? Information crucial to the understanding of the story being told.
Every novel has plenty of dry facts that the reader must be told - the details of an important moment from a character's past, for example, or the plan for robbing the bank, or the history of the town.
Such details, which are not a part of the story but are nevertheless important for understanding the story, are known as the story's exposition, and dialogue is one of the best methods there is for getting the information across.
The key to exposition, which always runs the risk of boring the readers, is to present it to them in bite-sized pieces. This makes the potentially dry facts more palatable and doesn't significantly disrupt the forward momentum of the story.
Beware, though, of characters telling each other things that they already know. A husband, for example, could never say this to his wife...
"Mary, my sister, had to take Florence, their miniature poodle, to the vet again."
The wife will already know that her husband's sister is called Mary and that Mary owns a poodle called Florence.
Such information is there solely for the benefit of the readers, and it sounds horribly stilted. Don't do it!
To summarize everything I have said, dialogue with purpose must do at least one of these things:
And if it does all three, so much the better.
You may feel the whole process of writing good dialogue, when reduced to rules such as these, is somewhat mechanical. And in a way it is.
Dialogue in fiction - and fiction itself, for that matter - is a representation of reality, not reality itself.
But once you have learnt all the "rules" - not just on writing good dialogue, but on everything else - you will find you can apply them to your novel (or choose not to apply them) without having to think about them at every turn.
Once you have mastered the novel writing rules, they won't blunt your creativity in the least.
Next Step...
Like I said at the top, there are three keys to writing good dialogue in fiction.
We have already dealt with the first of these: making sure your fictional conversations have a purpose.
Another key is to make the dialogue flow.
But first it is time to look at the importance of writing dialogue concisely...