Dialogue is one of those things that can be incredibly tricky - you've gotta have things for people to say but you've also gotta get out specific tidbits of information to keep your story moving forward and develop little things like 'subtext' and 'tension'.
So, how does one do that?
Well, here's what works for me:
My first and only 'rule' of writing dialogue is that you have to have a good strong mix of no fear and no shame.
'Cause you're going to need both.
I had my fear/shame matrix shattered in one rather scary/crazy/fun summer of being a door-to-door salesman in a suburb of Toronto called Scarborough (and yeah... you learn quick).
Personally, I believe that I'm not going to learn about writing good dialogue in a book. I'm going to learn that writer's version of what good dialogue is.
Which, well, if they're really successful is great - but still, I'm only learning what worked for them. But it won't be my voice.
The best advice I ever got about writing dialogue was that I should go and listen to the type of person I'm trying to write about in real life.
Ie. if I want to write about bikers, go chill in a biker bar and just listen to how bikers talk.
(Note: I have yet to try this one out)
But the idea behind it is valid. Want to learn how geeks speak? What sort of geek? Is he a techie? Is she a gamer? Are they table-top roleplayers? Or comic book fanboys?
This is where the 'no fear/no shame' rule comes into play: Ask to hang out with them.
There are tons of groups of people hanging out all the time. Get involved.
I've been to LARP games and game conventions and spent all sorts of time in comic shops.
Granted I have a leg up because I'm already a gamer/rp'er/comic geek... but they're all different characters to learn and distill.
When I wanted to learn about construction workers and how they get along, I tagged along with my dad to his work. I'll help him pull some nails out of 2x4s and listen to him and his crew banter.
I'm looking for structure and cadence, what words do they emphasize or slur or mispronounce?
Sometimes it's nice to sit in a mall sometimes with a notebook and just chill out and listen to people as they walk by. You'd be surprised on some of the stuff you can pick up.
Yes, this is also known as 'eavesdropping'... but it's kind of par for the course when you're a writer. :P
I'm there to learn what people say - or goes unsaid - or is said with a dagger-eyed look. Where tension bubbles up or releases, how quickly conflict arises and is brushed away because people decide it's not worth the fight.
Or that it is.
To me, the best way to get better at dialogue is to truly listen to how other people talk and react and feel, and then pass it through my own internal filter.
'Cause all of this is just raw material. I'll rarely ever use exactly what someone says in a script. My job is not to make my dialogue 'real' my job is to make it 'sound' real.
I've gotta take all that I've learned and process it and make it my own. I've gotta use everything I know about drama and comedy and tension and exposition to create (cough up) whatever puzzle piece I need at any given moment.
Which is something I can do because I now have something to compare it to. I know that someone would sound like 'this' -- or at least my character would sound like 'this' -- so I can hold it up to what I've learned and compare the results.
I can sneak in things like subtext and tension because I've watched how people do it in real life. How they skip around words or look away or hide their intentions with distractions. I can make my dialogue sing because I now know what I want to say and how best to say it.
Is this the only way to do it? Hell no.
But like I said, it works for me.
Hope that helps!