There’s a certain famous author who writes very suspenseful, exciting plots, but who I can no longer read because the dialogue is so hokey, it just kills me (No, I’m not going to say who it is).
I think dialogue can be a bit tricky because it serves so many purposes. It can’t be fully like real dialogue, as in real life we talk at the same time and don’t always make sense to anyone else but the person we are talking to- and sometimes not even then. So, our dialogue has to make some sense to the reader. It also has to convey some plot information without it being too obvious that it’s doing so:
“So, what was it that happened in your childhood again that makes you snap every time someone says the word ‘pomegranate’?”
“Funny that you should ask…”
(I’m not great at on the fly examples… ask my students)
In theater, there’s a similar problem. How does one act naturally in portraying a character while doing it in a non-natural space (facing the audience, not stepping on another’s lines, knowing what to do with one’s hands, etc.) One of the best things I’ve found to do to solve both these problems is to study real people.
People-watching at the mall, at school, with family, etc. is a great way to see how people really talk about things. I often listen in to parts of conversations when I’m in public spaces and consciously consider how people interact and why they say the things they do. I find many conversational gems that way that I would never be able to come up with on my own. When I want my characters to be realistic, I find it best to draw from reality.