There are three forms dialogue can take: summary (They talked all class about dialogue), indirect speech (And did they enjoy the stories about dialogue? Yes, they did, thank you), and direct quotation (“And did you enjoy the stories about dialogue?”)
The purpose of dialogue: Dialogue should not be used merely to convey information. It should also characterize, provide exposition (ideally in an engaging, masked way), set the scene, advance the story, and foreshadow or remind us of something else. Review your dialogue and see if it is doing more than one thing; if not, it’s probably lacking something.
One way to give your dialogue multiple purposes is to cut out conversational filler. Do not include “um,” “uh,” “I mean,” every single “Hey” or “Hi”; enter phone conversations after the people have said “Hello?” Good dialogue on the page does not resemble actual speech, which is far more unwieldy and convoluted. In general, keep sentences short; people rarely make long speeches or speak in extended sentences in real life (except when lecturing), and it looks even more forced on the page.
A character’s choice of language, his or her verbal tics, whether he asks a lot questions, and so on reveals much about him. All your characters should sound different, with their own vocabularies and rhythms; if two sound exactly the same, maybe it’s a sign you should conflate the two into one character. Read your dialogue out loud to hear if it sounds right, and trust your ear.
Dialogue as action: Do not have your characters discuss a topic without the possibility for some sort of change. If two stubborn characters go back and forth about abortion, at best you’ve written a philosophical tract; at worst, an after-school special. If one is not going to give in, at least show us that there is a real emotional stake in this argument (one is pregnant and is committed to having an abortion the next day). To make this static argument even more compelling, recognize that people change their tactics when they talk—one of the characters can start off friendly and ingratiating, then becomes manipulative, then guilt-tripping, and finally hostile. Also try to give both characters something they both want (most likely different things); if only one wants something and the other doesn’t care, the exchange will have less conflict.
Text and subtext: Your dialogue should always strive to say a little (or a lot) more than what’s actually spoken. At times you’ll need an explicit line like “I want a divorce,” which says everything that needs to be said. But these should be kept to a minimum; they don’t give the reader any chance for interpretation, unlike a loaded line such as, “I heard Bob and Joan are breaking up,” which might suggest that the speaker (depending on what we know about her) is also thinking about breaking up with her partner. Keeping your dialogue economical is one aid to enhancing subtext, because in cutting out superfluous words you may also be trimming superfluous sentiments.
“He said/she said” and adverbs: Be very, very careful with synonyms for “said,” other than “asked,” “answered,” “replied,” “added,” “continued,” “recalled,” “remembered,” and “reminded.” Make sure they’re as specifically attuned as possible to the way the dialogue is being spoken (“whispered,” “boomed,” “squeaked”), and not simply an excuse to use the thesaurus (“declared,” “intoned,” “affirmed,” etc.)—it looks amateurish and conspicuous, whereas “said” fades into the background and we pay attention to the dialogue itself. When it’s not necessary (either because it’s obvious who is speaking from the tone or it’s clear from where the dialogue takes place in the paragraph), cut out “he said” or “she said” altogether—but too many of these exchanges can make your prose look like the script for a play. When you do need a dialogue tag, it’s good to interrupt a long stretch of dialogue with a dialogue tag near the beginning, often after the first sentence (“Blah blah blah for a sentence,” he said. “Blah blah blah for four more sentences.”). Occasionally vary “Jim said” with “said Jim” so it doesn’t get monotonous; the main difference is the latter has a slightly more formal, antiquated feel to it. (But never use “said he” or “said she.”)
Likewise, try to avoid adverbial modifiers for dialogue: “He said loudly” is “He yelled”; “She said softly” is “She whispered.” If you have “He said sharply” or “He said with sharpness in his voice,” then cut “sharply/sharpness in his voice” and make the dialogue itself barbed. The tone of the dialogue should be self-evident.