Something that comes up over and over is dialogue formatting. Writing dialogue well is a skill, but getting the formatting correct is simply a matter of knowing the rules. So, here are some example lines to help explain.
“Good morning, Harry,” she says.
The above line has two parts: the dialogue and the speech tag afterwards. The important thing to remember is that these two parts form one complete sentence. That’s why you need a comma at the end of the dialogue, not a full stop. “Good morning, Harry.” I say is wrong because it separates them. If I see a book with dialogue like this, I won’t buy it, no matter how good it sounds.
“Morning? It can’t be morning, Lavie.” He pulls himself out from under the bench.
Here, there is no speech tag, so the sentence finishes at the end of the dialogue. So in this case, a period is appropriate, as is the capital letter on he.
“Well it is. Are you still drunk?” she asks suspiciously.
More confusing, this one. When you use a question mark or exclamation mark, you need a lower case letter after the dialogue, when it follows a speech tag. Remember, though, that they’re part of the same sentence.
“No of course not!” He struggles to his feet.
Whereas in this case, there is no speech tag and the sentence ends. So He needs capitalising.
“Oh really? So how many fingers am I holding up?”
He squints at her for a moment. “Which one of you?”
Another common mistake is not to separate the speaker’s lines, if someone else acts. Because it’s Harry who does something next in the story, and not Lavie, who spoke, the line about him squinting needs to go down one. Otherwise it becomes very hard to track who is speaking when there is no speech tag identifying them.
Finally remember, you need a comma before or after an address in dialogue. An address might be a name, a title, an insult etc. Some way for speaker to refer to person they are speaking to. If the address comes in the middle of the sentence, you need a comma either side.