This is a simple but important classroom management technique.
Firstly, we have all been in the situation as teachers when a student misbehaves and as a consequence we react emotionally and make a threat to the student, either in an aggressive tone or in an exaggerated response that we deep down know that we can't follow through on. I believe it invites confrontation from students.
I recall once when a student wouldn't stop talking, I lost my patience and said to the student, either behave or I will kick you out of this room. Not only was I not focused on the solution, I had also demonstrated to the student that I was losing control of the situation.
Instead keep calm and focus on the solution to the behavior. I suggest taking the following approach.
1. Remind yourself, you don't want an argument, you simply want the solution to this behaviour!
2. Calmly speak one to one with the student and make a promise to the student with a choice laid out. - "If you repeatedly shout out, I will ask you to leave the room or if you choose to stop shouting out you will be able to stay"
3. Say it slowly and calmly so that it is communicated authoritatively.
4. Then follow through depending on the students response. If the shouting out continues, then act! This is fair because the student was informed and given a choice.
5. Do not engaged in any argument or debate with the student - simply respond,, "I gave you a choice."