QUESTION: I have trouble trying to figure out when to begin and end paragraphs and when to have dialogue included in the paragraph and when to have it stand on its own as an independent paragraph.
Unlike nonfiction, there are no hard and fast rules for paragraphing in fiction. Much of this is the writer's choice which is informed by experience as well as their need to emphasize certain things or break between actions.
And, surprisingly, some choices are as much visual as mental. Most readers, these days, don't like long paragraphs so many writers paragraph more frequently than did past writers.
Here are some good rules of thumb, though.
When you start with narrative followed by dialogue, the narrative should be about the person who will speak.
Adam studied the book's page then glanced back up at his friend. "Pete, we have a problem here."
If the narrative was about Pete, Adam's line would be in a new paragraph.
Pete watched his friend anxiously as he read the rule book.
"Pete, we have a problem here."
If you have a long bit of narrative, it's usually a good stylistic choice to paragraph before the character's lines. This breaks up the lines visually, and it also emphasizes the dialogue.
When you are writing a long speech by a character, you paragraph to emphasize subject, changes in subject, and the rhythm of the scene.
If you aren't sure about any of the above, read the dialogue aloud as the character would speak it. Notice when you have natural pauses. That's a good place for a paragraph break.
Dialogue shouldn't be too long, though. Break it up with a bit of narrative like
Adam shook his head in disgust and continued,
Or have other characters react or comment.
"I can't believe Pete said that. It doesn't sound like him."
For straight narrative with no dialogue, you should paragraph when the action shifts to another character.
Pete tripped but caught himself before falling flat on his face.
Behind him, the sound of Adam's running feet moved toward him, then his friend stopped at his side.
On the whole issue of paragraphing, don't be too uptight about it.
As long as the reader is clear about what is happening and the page isn't covered by long paragraphs, he won't even notice when you paragraph.