In a recent previous post I tried to illuminate the very large and challenging thing that writing good dialogue is. I said it is about developing the strongest empathy muscle within you that you can. It is about what therapists call Theory of The Mind, which is the ability to put yourself in the mind of another person and feel what they feel in the way they feel and interpret their emotional, psychological and physical states.
That is a big job and should wake writers up to the fact that most advice on dialogue (and writing in general) skims this surface. This isn't to say it is bad or untrue, just incomplete and cliche. To my way of thinking, good writing advice and coaching will help the writer first see the entirety of the challenge and then help them break it down into iterative steps or problems to be solved. In short, make a big difficult problem seem and in actuality be easier to manage and work through.
The last dialogue post was meant to illuminate the size of the challenge. This is meant to help break it down a bit into something that feels entirely manageable. Or at least provide a road map.
Dialogue should be active. It should be two or more characters with agendas trying to move their agenda forward by promoting their position, hindering that of the other character(s), or obtuse to the needs, desires and agenda of the other character(s).
As James Scott Bell writes in his book on dialogue How to write Dazzling Dialogue (a good book worth getting): Dramatic dialogue should always be a compression and extension of action... So the first secret of dazzling dialogue is to give your characters their own agenda checks in each scene. And then put those agendas in opposition.
Unpacking this a little bit, a character speaks only because they have something burning within them to say. And what they say in some way challenges the other character(s) because they have an agenda within the scene they want to achieve. This is true in nearly all situations. For example, it is obvious when one character is in open conflict with another, but it is true in scenes where, for example, a mother is speaking to her daughter before she goes out on a date. It is true when a wife speaks to her husband. When two best friends try to figure out how one of them should ask a girl out. When a group of kids are picking sides for a baseball game. And on and on.
Whenever you speak in any meaningful way with a friend, lover, family member, child, you have a reason for doing so, an agenda you want to accomplish. This is true even if it is only about what to have for dinner.
In fiction and nonfiction, dialogue and voice are used to move this compression and extension of action forward. To do this you need to have empathy and understand Theory of The Mind. To get to that, it is very helpful, as Bell says, to do an agenda check for each scene and each bit of dialogue. What does each character want in each exchange? How, through speaking, are they going to attempt to get what they want? How will each intentionally or unintentionally thwart the other character(s)? What are their strategies and how do they fit within the character as a whole person?