Writing dialogue presents a terrific challenge in that no two conversations are alike, even if the words are the same, and no two people are alike, and the words used are only half of it. Crafting good dialogue is part of the art of characterization. Eavesdrop on or watch any conversation you can. You will notice:
a. speech patterns, regional accents, vocabulary and slang, speech impediments, volume. Re "accents": One hint of an accent (incorrectly known as "dialect") goes a long, long way. Do not write at length using misspellings ("Ah cain't make head ner tail o' whatcha' all talkin' 'bout, brutha"); it's hard to read. Your reader will soon give up. Use such things as a spice, not a meal. Better: "I can't make head ner tail of what you're talking about, brother."
b. nonverbal portions of conversations: hand gestures, scratching an itch, punching fist in hand, eye-rolling, "air quotes," and so on.
c. About half the time, people don't talk back-and-forth as much as they talk "across" each other, impressionistically: Person A: "So, how's your husband these days?" Person B: "I can't believe how fast the laundry's piling up."
d. Note the proportions of time taken up by the speakers. Half and half, or does one person talk far more than the other?
e. nonverbal portions of oral communication, such as laughter, hooting, Bronx cheer, making the sound of vomiting, yawning, "Eh?", "Huh?", whistles, and so on.
f. A huge percentage of conversation is "canned" or pre-fabricated phrases: "How are you?" "Fine, and you?" "I'm hangin' in there." Unless there is a reason to include those pre-fab greeting exchanges, don't put them in. Also frequently appearing in conversation are quotations, cliches and advice. Some people often say "It's a dog-eat-dog world," or "As my father always said," or "Garbage in, garbage out,"and so on.
g. People who are acquainted rarely address each other by name except as a strategy, often a selling strategy. Nervous writers do this to make sure the readers know who is speaking. Most of the time if dialogue is between two people we know who is speaking (the more so if their speech patterns are correctly differentiated). We do not say to a co-worker "Good morning, Susan. Say, Susan! What happened after I left last night?" "Marsha, you are just the person I wanted to talk to. You won't believe it, Marsha!" "Susan! Wait! There's a dead mouse beneath my desk! Susan, call maintenance!" "Oh my God, Marsha, I will call right now!"
h. People have pet words and phrases. Some always say "Okey-dokey." Some employ a word or phrase over and over, such as "bizarre," or "twee" or "inappropriate behavior."
Use dialogue only when it's important to do precisely that. Perfunctory or tangential exchanges can be deleted or rendered as indirect dialogue. "She told him she'd waited for the tow truck for an hour."
Okay, now you are educated!