Tips for writing great dialogue!
Note that these all have to do with writing technique rather than structure.
Don't deviate too far from the point of a conversation, but while you're writing, consider what reactions and questions might pop up organically. To you, this is a script; to the reader/viewer and characters, however, it's a conversation. Treat it like one! The best dialogue is, in most cases, dialogue that reads as natural for the characters involved.
Remember that characterization is a filter, not a prison. While all characters won't react to something the exact same way, they can and should have an equivalent reaction. A loud outburst might turn into a cold one-word response. What's important is that those two reactions have the same impact. If they don't, then something needs to change.
Learn the art of implications. A lot can be learned from a short back and forth, and I don't mean the type that spoon-feeds information to the audience. The way the characters talk (volume, emotion, even speed), the words they choose, the moment they choose to say somethingโit all communicates info to the audience about each character. Use this to its full advantage. Even something as simple as a question can say a lot. Why did Character A ask it? What does that say about them? What does that say about their relationship to Character B? What does it say about their circumstances?
Related to the last point: every piece of dialogue should have purpose. That doesn't mean it has to have purpose to the characters per se, but it should tell the audience something. If the dialogue doesn't develop characterization, tell about a relationship, provide new information, or further the plot (or another useful function), then it doesn't need to be included at all.
What isn't said is just as important as what is. How much attention you want to bring to the unsaid is up to you, but the significance of an absent "I love you" or "Thank you" cannot be understated, especially in high-tension scenes or when illustrating complex dynamics. But it isn't always necessarily negativeโare the words unsaid because Character A doesn't mean them, or because they're so easily known that saying them aloud would be redundant/out-of-character?
The way a character talks should be deliberate and consistent. If they're from a specific area, do they have an accent? Do they use foreign slang terms? Is this their native language? How might their culture (be it national, local, etc.) affect their demeanor and the way they speak to others? How might their speech shift based on mood and familiarity? These are all things to consider, and mentioning speech quirks like this can give Character B depth even if Character A doesn't know where they come from.
Most readers/viewers will be satisfied with good dialogue, but especially in emotion-heavy stories, great dialogue can make all the difference and leave a more lasting impact on your audience. Hopefully these tips can help elevate your writing and bridge that gap :)