Dialogue can be tricky. Instead of being told by your usual narrator, dialogue lets each of your characters speak for themselves. The number of voices you have to worry about increases with each character in the conversation. You must piece together the tone, word choice, goals, and emotions of each speaker, all while still continuing the narration in the rest of the book. It's a lot to juggle.
As an author, sometimes it is very easy to see how a conversation is working towards the plot, but to forget what the characters are trying to do. For example, you might know that one of the characters is in love with the other, but the characters might not both know. If they do know, one or the other might be trying to avoid the topic. So, while you are trying to show that detail to the readers, you can't forget what the goals of the characters are. They likely won't align with yours and, as in the case above, they might not match each other's either.
What does your character want out of this conversation?
Maybe they are asking for a favor or venting about their day. Maybe they are making plans for the weekend or weighing whether or not to go on a second date. These purposes will affect what each character says, how they say it, and what they ignore or dismiss.
Depending on their reasons for talking, the characters will respond very differently to the questions and answers they receive. A character who is killing time may let the conversation wander to whatever the other character wants to talk about. A character who is looking for an answer will pursue their question, despite attempts to avoid or change the subject.
Make sure your characters respond in a way that meets their own goals, even if that sometimes means avoiding a question or repeating themselves.
It's likely that your characters won't always be able to achieve their conversation goals, so once the scene has achieved its plot purposes, you may need to cut it off. You can do this in a lot of ways. Maybe one character storms out, perhaps a timer goes off, or the building explodes. It's also possible to fade out and let the characters finish talking in private. The important thing is to keep the story moving forward without sacrificing your characters' intentions.
How invested is the character in the conversation?
Consider what they are willing to offer of themselves in order to achieve their goals. A casual acquaintance or a public conversation will usually receive shallow answers and polite responses, whether or not those responses really reflect the true feelings of the characters speaking. But whispered conversations at 2 am are likely to have characters speaking in long meandering chunks and saying things even they didn't know they thought or felt.
How do the characters feel about each other?
The relationship between the characters will be a significant factor in how they talk to each other.
Are they friendly or antagonistic?
Are they familiar or strangers?
Are they equals or is there a power imbalance?
These factors will determine how direct or straightforward the characters can be with each other.
Can they demand things or must they ask nicely?
Do they need to provide context or are they already on the same page?
Will emotional pleas pay off or make the other person uncomfortable?
Does the character feel comfortable sharing personal details?
By keeping the character’s goals and relationships in mind, you can add conflict and drama to a conversation and make sure readers are on the edge of their seats.
About my coauthor:
Elestrei Engrei was a huge help at providing the author perspective for this post