Welcome to AW, juliana!
This question, other than the punctuating (which other posters have already explained well), is really in the realm of art rather than mechanics. I'm afraid many of the answers are going to be somewhat similar to the characters' assertions in
The Blind Man and the Elephant. (Btw, if you've somehow missed out on this wonderful poem, you can find it here:
https://www.poemhunter.com/poem/the-blind-man-and-the-elephant/.)
The place where I've learned to do this is the Share Your Work forums. You can't post work for critique there until you have fifty posts, but there's no reason why you can't lurk and learn. And any contribution, no matter how humble, is valued. Swear to God, when I started out, all I felt qualified to do was cheerleading--telling people that their queries really were improving, even if they couldn't see it. From there I progressed to line-editing a single sentence. (Woo-hoo.
)
But, y'know, with time and study comes competence--I promise.
I can give you some basic guidelines, but be aware that I'm sure better writers than me have done otherwise and pulled it off brilliantly. Still, FWIW, perhaps this will help.
1) When in doubt on tags, use said or asked. Whispered is okay
if there's a reason to whisper. You can use replied if they're actually replying to something, but not too often. When you have a page filled with mumbled, shouted, raged, yelled, screeched, etc. (these things are also known as said-bookisms), they call too much attention to themselves. In fact, this is one way I use them--to hang a lantern on (writer term for adding subtle emphasis) an important piece of dialogue that might otherwise get overlooked.
2) When using tags, only add adverbs if they truly add, and use them sparingly. When one character says something coolly, and another character replies hotly, I'm so squirmy over their adverb use that I lose track of the narrative. Most of this should be redundant if your dialogue is strong enough. Note: If you write Middle Grade, this age group seems to be more tolerant of tag+adverb, probably because 11-14 year olds are still acquiring contextual skills that adult readers already have.
3) Beats are a great alternative, but they have dangers as well. When you have characters smiling, nodding, grinning, shrugging, etc. all over the page, they begin to resemble bobblehead dolls. Only use a beat if there's a reason to do so. I have the SYW critters/denizens to thank for breaking me of this, so don't feel bad if you slip up even when you know this.
4) An alternative to the simple beat is a more complex one:
"I just don't know." She rubbed her eyes and slumped in her chair.
These can be excellent, but use too many and your pacing is screwed.
5) ONE beat or tag is usually enough. You don't need to identify the speaker multiple times:
"I just don't know," she said. She rubbed her eyes and slumped forward in her chair. Then she took a long drag on her cigarette.
Okay, this could actually work, but just be certain this is what you really want--a pause of this magnitude interrupting your flow.
6) Try not to interrupt your dialogue too often. A kind beta reader pointed out to me how annoying this is--and how often I did it:
"I just don't know," she said. She rubbed her eyes and slumped forward in her chair. "There are too many choices and I'm too tired to deal with this." She took a long drag of her cigarette and stubbed it out. "Screw it--I'm going to bed."
This one doesn't read too badly, but too much of this sort of thing will kill your pacing, too, and pacing is super-important.
And 7) Don't worry about ANY of this stuff while you're drafting--it can paralyze you. Save all this for editing passes.
Hope something here helps.