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.
EXAMPLE"There's no place like home."
What if you were putting this quotation into a sentence that identified the speaker?
EXAMPLE"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.
EXAMPLE"There's no place like home," Dorothy said while clicking her heels together, "and I want to go back."
See how the first comma separates 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.