Insert the tag when you want to set off dialogue.
Separate the tag from the dialogue by placing a comma after the tag, when the tag precedes the dialogue: He said, "I never expected this to happen."
Place a comma at the end of the quote when the tag follows the dialogue: "Bake me a cake," she said.
Use basic tags such as "he said" or "she asked" to set off the dialogue, in most cases.
Write the speakers' thoughts or actions after the dialogue to avoid basic tag repetition, Jerome Stern suggests: "I didn't know you would be dropping by this late." Leslie quickly grabbed the wad of used tissues from the couch.