If you're a Big Bang fan, think Sheldon in the episode "The Friendship Algorithm":
(first two minutes specifically)
My kids absolutely have to conclude their vocalizations. HAVE TO. But part of my job is to teach them that when their compliance is asked for by an authority figure and it's not an unreasonable, dangerous or abusive demand, that compliance should be given. Out there in the real world, employers are not going to listen to them griping ad nauseum about a task. They're not. In the classroom, they need to be able to do the work without constantly vocalizing their extreme disgust with it.
So we work on it here, getting them to learn when it's appropriate, what tone is appropriate and so on. And I learn to remember that they aren't intentionally being disrespectful. By the way, explaining that abstract concept: almost impossible. Instead, we try to concretize it to "when you talk like this (and then parrot it back), the grown up you're saying it to will be unhappy and get mad and then you really have no hope of being heard."
Do you know how hard it is to get through to children who are in the middle of that track? They don't hush long enough for you to speak where they can listen, but you can't let them finish the inappropriate vocalization or you've reinforced that very behavior. It becomes a bit like that first two minutes of the above Big Bang episode; interrupt enough to not let them finish, distract them, do anything (appropriate) to stop it cold so that you can offer another way of handling that need to vocalize.
At times like these, I well understand how "easier" it was for parents when I was a kid in the late 60s and 70s. If you're old enough, you probably remember that most parents dealt with "backtalking" with the momentarily effective slap or smack. That for sure shut me up until I was out of hearing.
I'm not recommending punishment, far from it, in fact. It just flat out is ineffective in altering behavior long term in getting appropriate behavior to take the place of what has been deemed inappropriate. Maybe I need to do this, instead:
(starting at 4:50)
If I throw her (Lily was engaging in this behavior this morning) a chocolate, will she quit whining, "buuuuttttttttt mommmmmmyyyyyyy blah blah blah"? Or should I just eat the chocolate?