Today’s (second) glitch:
A lot of people have trouble knowing the difference between a dialogue tag (tells who said it and maybe how it was said) and an associated action. This confusion is (part of) why so many writers think it’s possible to smile a line of dialogue, or for a character to roll their eyes and have speech come out. (That is exactly what the writer is saying — whether they realize it or not — if they give you a sentence such as, He rolled his eyes, “I’m so sick of this.”) The unnamed English teacher/writing instructor who first started referring to both tags and actions as “beats” and got so many other people into the same bad habit has a lot to answer for…
You don’t have to choose between a tag and an associated action. You don’t have to use either one, although completely ignoring them will result in a bad case of “talking heads” in your story, and readers won’t have any idea of who is talking or what they’re doing. You can use both. You can alternate between them as you think appropriate. What you shouldn’t do (notice I am not saying you can’t — you can write any damn nonsensical thing you please) is to treat them as the same thing.
Look at the sample sentence. What’s the dialogue tag? That’s the he said part, right? Do we know if the speaker is doing anything other than just speaking? Yes. He’s also running his fingers through his hair. That’s why you need a comma after said.
“I never thought I’d end up here,” he said, running his fingers through his hair.
You could also choose to leave out the comma and add while after said: “I never thought I’d end up here,” he said while running his fingers through his hair. I think the former version flows better, though.