Dialogue is the way you talk about talking; it is a conversation that is recorded or invented in writing.
This means that any written dialogue is the transcription of a conversation between people—either fictional people having a conversation that the author made up, or real people having a conversation that the author accurately recorded.
In narrative writing, both fictional and non-fictional dialogue make up the conversations between characters.
There are lots of reasons to use dialogue in a piece of writing, but they all depend on the context and the type of writing you’re doing.
If you’re going to write out some dialogue, you need to show your readers that the words are being spoken. Thus, the most important tool you have is the quotation mark, which is a punctuation symbol used to set off dialogue.
Setting off dialogue means distinguishing it from the other kinds of sentences and words surrounding it. To show that something is a piece of quoted text or a piece of dialogue, you need to add beginning and ending quotation marks.
"There's no place like home."
What if you were putting this quotation into a sentence that identified the speaker? Your sentence would then look like this:
"There's no place like home," Dorothy said.
Note that the sentence ends after “Dorothy said,” as opposed to immediately after the quotation marks. Notice too, then, that there is a comma separating these two clauses.
The comma lives inside the quotation marks. That’s important because a comma is a punctuation symbol used in multiple ways to indicate a pause or particular organization. So here, the comma tells you to pause, and indicates that what’s inside the quotation marks is the actual quotation while what’s outside is not.
You also know that in real life, conversations sometimes get interrupted. It’s possible to show that disruption in writing, if and when you need to interrupt a piece of dialogue to add something in.
In that case, you’d use the quotation marks and the comma to show where the dialogue is and where it isn’t.
"There's no place like home," Dorothy said while clicking her heels together, "and I want to go back."
See how the first commas separate the dialogue and the interruption, and another comma separates the interruption and the next piece of dialogue? Then the whole sentence ends with a period inside the quotation mark.
Start with the easiest part. Where should you put the quotation marks? Around the quotation. Even if you didn’t know that Dorothy said “There’s no place like home,” you’d have a hint about where the quotation starts because of the introduction “and said.”
Then where should you put the period? After “home'” because it goes at the end of the sentence, but inside the quotation marks.
Finally, where are the commas? Remember that there should be a comma to separate the quotation from an interrupting clause, but there isn’t an interruption here. There is, however, an introduction, underlined below.
Dorothy clicked her heels together and said, "There's no place like home."
Thus, the comma should go between the clause “Dorothy clicked her heels together and said” and the quotation.
Source: This work is adapted from Sophia author Martina Shabram.