Writing believable dialogue is not the same thing as realistic dialogue.
Nothing is 'realistic' in fiction. It shouldn't be. But it SHOULD be believable.
This is particularly true of dialogue.
Take a few minutes and just listen to a conversation. Especially if you're listening to teenagers, or a certain talkative 11-year-old I know, the speech is scattered with 'ums' and 'likes' and 'you knows.' You can find examples of 'realistic' dialogue in radio transcripts, in which voice recognition software records every utterance that comes out of the speakers mouths. Here's an example from a popular radio show:
SPEAKER: "I mean, I think I agree with you morally that she doesn't deserve it and I mean, I don't know if there's a great person in this story but, like, the guy, he's a dirtbag. So I would root against him in every case. But legally, I mean, when you have -- she had the ticket in her possession, it becomes communal property of the marriage. So whether -- I mean, you can't -- that's like she's lying when they get divorced by claiming she doesn't have $28 million. I mean, she really could be charged with that, couldn't she?"
That's REAL, but it's not very pleasant to read. We hear it all the time and process it without thinking, but when we see it on the page, when we process it through our eyes instead of our ears, it seems somewhat odd, unnatural.
Fortunately for us, the convention in writing fiction is not to convey REAL dialogue, but to convey BELIEVABLE dialogue. So, as writers, we clean it up. We remove the stammering, the injected meaningless words, the interrupted sentences. Had this paragraph of dialogue come from a fiction writer, it might look something like this:
"Morally, I agree," he said. "She doesn't deserve it. But who is there to like here? He's a dirtbag, and I'd root against him in any other argument. But what she did--it wasn't legal, was it?"
It's not real. But it conveys the message in a believable way without burdening the reader's thought process with nuances that cannot be heard. Those nuances, when understood perfectly well in heard speech, can make written dialogue confusing, as I think you can see from the transcript example.
Some other tips for writing believable dialogue:
USE CONTRACTIONS: Dialogue that does away with contractions feels stilted and overly formal. There are instances in which you would NOT use contractions, for instance when a speaker is giving a short sentence particular emphasis. But for the most part contract where you can.
BE CAUTIOUS WITH DIALECT: I've already written about using dialect in dialogue, HERE.
DIALOGUE TAGS: It is a great temptation for new writers to use overly descriptive dialogue tags that replace the simple 'said. These are known as 'said bookisms.' You've seen them before. "I love you," he whispered, or yelled, or called, or some such. Some of the worst are those that are impossible to do while speaking, such as "I love you," he laughed, or sneered, or hissed. Those words don't actually describe a type of speech. Hissing, for example, is when you put your teeth together and make an S sound through them. You don't actually speak like that. No one does. Don't believe me? Try it.
You may also be tempted to use Tom Swifties, which are adverbial dialogue description tags such as "I love you," sneered Tom jauntily. These kinds of tags earned their name from a series of juvenile fiction books in which the author badly abused these types of tags, to the point of being laughable.
Avoid these types of tags by giving the characters actions or putting them into situations in which the WAY the dialogue is said is obvious. For instance, if our hero leans in close and his lips brush my ear, all I need to write is, "I love you," he said. We KNOW, by inference, that he's whispering it. With a little more narrative describing the setting (for instance, a bedroom, or maybe he's stroking our heroine's hair), the reader can also infer that he said it seductively, all without ever telling the reader that this is how she should interpret the way he said it.
There will occasionally be instances in which a Tom Swifty or a Said Bookism is warranted, but these instances should be rare.
DIALOGUE AND THE INFO DUMP: Be cautious about using dialogue to give important information to your reader. It's a huge temptation for new writers to have a speaker give the reader a bunch of information that everyone in the fictional universe already knows. Characters can give information, but it should be information that is new to their fictional audience. If your character is capable of saying, "As you know..." before conveying some information, then he shouldn't be conveying that information through dialogue.
INTERRUPTED CONVERSATION: Be cautious about using an excess of descriptive narration within dialogue. Think about conversations in real life, conversations that you enjoy listening to. The banter goes back and forth, sometimes someone makes a gesture, or sits down, or takes a sip of coffee. No narrator steps out of the wings to explain the background behind what is said, interrupting the dialogue to do so. You've seen the gimmick before on some comedic TV show. The action in the scene freezes so someone can step in front of the camera to explain something, then he drops out and the scene continues. It's an unnecessary interruption of the scene and it's annoying--which is why it's parodied. The only thing that should interrupt your dialogue is action--movements the characters might make as they converse. We do this to minutely break up the dialogue (because several pages of nothing but dialogue can be tedious to read), and to give a sense that the speakers are real, that they aren't just standing there like cardboard cutouts with moving lips.
PUNCTUATION: As an editor, I'm acutely aware of errors in punctuation. And errors in dialogue punctuation can be particularly confusing. Know the rules of puncuation and paragraphing dialogue, and utilize those rules correctly. For some basic dialogue punctuation rules, go HERE.