Dialogue Basics
The dialogue tag can go before, after, or inside the dialogue:
Before: Jane said, "I'm saying words." (Note the comma after said and the period at the end of the statement, inside the quotation marks.)
After: "I'm saying words," Jane said. "I'm saying words," said Jane. (Note the comma at the end of the statement, inside the quotation marks, and the uncapitalized said.) "Am I saying words?" asked Jane. (Note the question mark at the end of the question, inside the quotation marks, and the uncapitalized asked.) "I'm saying words." The woman spoke authoritatively. (Note the period at the end of the statement, inside the quotation marks. That's because after the quotation marks is a new sentence. The word after the quotation marks is capitalized.)
Inside: "I'm saying words," Jane said, "and you are reading them." (Common) "I'm saying words," said Jane, "and you are reading them." (Uncommon) (Note the comma at the end of the first part of the statement, inside the quotation marks, and after the end of the dialogue tags. Note also that both "said" and "and" are uncapitalized. That's because this is all one big sentence, which ends with the period.) "I'm saying words," Jane said. "You are reading them." "I'm saying words," said Jane. "You are reading them." (Note the comma at the end of the first part of the statement, inside the quotation marks, but the period after the dialogue tags. That's because this is one sentence. The next line of dialogue is a new complete sentence, so the first word is capitalized.)
Enclose all* dialogue inside quotation marks.
Correct: "I'm saying words," Jane said. Incorrect: I'm saying words, Jane said.
*There are some stylistic reasons for not using quotation marks, including if you want to distinguish speach from other forms of communication like telepathy, but it should be intentional, and unless it's done well it can be super hard to read.
Only have one person speak per paragraph.
Correct: "I'm saying words," Jane said. "And I'm reading them," Tom said. Incorrect: "I'm saying words," Jane said. "And I'm reading them," Tom said.
Keep a person's name with the line they're speaking.*
Correct: "I'm saying words," Jane said. Tom smiled. "And I'm reading them." Incorrect: "I'm saying words." Tom smiled. "And I'm reading them."
*This is another one of those ones where there can be stylistic reasons to break from it, but you need to be careful, because it can become very confusing.