As writers, we don't want to write the way people really talk. Real speech is full of ums and ers, backtracking and repetition, and telling people things they already know. What we want to do is give the impression of how people really talk. So we make liberal use of sentence fragments and comma splices, idiomatic and clichéd phrases, as well as intentional misspellings that indicate region, ethnicity, or class.
Avoid drowning your dialogue in phrases such as exclaimed, murmured, shouted, whimpered, asserted, inquired, demanded, queried, thundered, whispered, and muttered. These words make it sound as if you have fallen in love with your thesaurus. In most cases, the word "said" works just fine, and using colourful tags detracts from the dialogue.
On the other hand, they can be effective when used sparingly and with due reflection. For example "he growled" can be safely used in a love scene to convey sexual desire without being inappropriately explicit. Equally, "snarled, hissed, or barked" can illustrate a personal characteristic or highlight an emotion that's essential to the plot.
One dialogue tag to avoid, "He ejaculated." At the very least, don't use it during a sex scene – unless you want a laugh. And don’t let your hero say something ‘cockily’ either. Laughter is the surest way to ruin the ambiance of a passionate love scene.
Watch the adverbs in your dialogue tags as well. If a character’s words are already angry, you don’t need to insert the word “angrily” after “she said.” However, adverbs come in handy when a reader may be confused about how the dialogue is said. For instance, if you write: “What are you doing here?” she asked. The reader doesn’t know whether she’s pleasantly surprised, upset, or angry. But if you write: “What are you doing here,” she asked angrily, the reader knows how she’s feeling.
Don’t just have your characters standing, or sitting, across from one another rambling on and on. Have them emphasize what they’re saying with their hands. Have them move around – sit down, stand up, pace. Be aware of their facial expression, especially the eyes. But watch out for eyes that “follow people around”. A gaze might do this, but eyes stay in a person’s skull, unless perhaps you’re writing a horror story.
Your characters are probably not going to be holding a conversation in a completely empty room. Have your character pick up a book, crumple a paper, put their fist through a wall. The items in a room can be fiddled with, gestured with, tapped – they put a static character in motion. Characters should never sit still unless the stillness is a device itself.
Dialogue should have a purpose. Most often that purpose is to relay important information, but it can also increase suspense, clarify what a character wants, strengthen (or weaken) their resolve, or even change their situation for better or worse. Above all, dialogue should move the story forward.