When I started writing, I noticed something unexpected and distressing: I found writing dialogue really really hard. Describing scenery? Cinch. Explaining pseudo-science-y stuff? Easy peasy. A simple conversation between two people? Mind-numbingly difficult. Why? I mean, I'm a human being. I have conversations all the time! Having now connected with many aspiring authors, I found that I was not alone in this problem. So, here's at least my take on the issue and what I did to solve it.
The problem is that you're seeing the conversation in your head and you know the direction you want it to go. So you end up forcing it in different directions than it might go naturally. The result can be stilted and unnatural-feeling conversation that at best is not entirely believable, and at worst in cringe-worthy and jolts the reader out of your carefully constructed world. No one likes being forced back into reality like that. No one.
Here are the two things that I found worked for me. And by "worked" I mean made me feel more comfortable with writing dialogue and resulted in my wife less frequently saying, "this dialogue doesn't feel believable."
1. Throw away the script. You have to allow your characters room to breathe. Get in their heads and allow them to react to the other characters and situation in a way that is natural for them. You may find that things end up going in a different direction then you intended, and that's fine. Frequently, I have to make minor adjustments to the story after a large dialogue scene because my characters changed the scene without my permission. But if that's what it takes to make the dialogue flow naturally and allow your characters to take on a life of their own, then so be it. Your reader is much more likely to enjoy the scene (and the whole story) if it felt natural. They aren't going to know that you had originally planned something slightly different and had to change it.
2. Act it out! Disclaimer: I no longer do this. But when I first started, I found it very helpful. To help me get the flow, inflection and nuances of a conversation down, I asked my partner in crime (my wife) to help by acting out a few dialogue scenes with me... without a script. Thankfully, she agreed and indulged me. I set the scene and discussed the type of people the characters were to be and we did some improv. It may sound silly, but it really helped at the time and let me see study how conversations more organically develop. If you're anything like me, the prospect of having someone else act out parts of your rough draft is highly embarrassing. Well, all in the name of progress! Like I said, this may not be for everyone.
If anyone else has advice or wants to share what worked for them when it comes to dialogue, feel free to comment!