It's very difficult sometimes, because you can't ignore it (the other students are watching), and you certainly can't condone it.
Therefore, what do you do?
Well, it all depends on the situation.
If it's a serious situation, you definitely need to handle it immediately. The safety of everyone involved is of the utmost importance.
If it's a serious situation, but not necessarily a safety issue, you still probably need to deal with it immediately … as it can escalate rather quickly.
For the moderate "annoying" situations (where it's sometimes habitual in nature), you really need to take care of it early in the process, but not necessarily right away… because that's exactly what they want: the attention.
Therefore, in most situations of negative behavior in our classroom, it is of the moderate situation, and can easily be addressed (as long as you stay calm and consistent).
My way of handling most of these situations is to use the "step aside" chair.
This chair is just outside the group of students, but still close enough to still be involved. We role play before anyone goes into the step aside chair so that they know exactly what will happen.
Basically, I say "please step aside, I'll be with you in a minute."
This does 2 things effectively:
1.) It tells all of the students that are behaving that I value them, and will continue to value their excellent behavior immediately (and that I'm not going to put up with whatever negative behavior that just happened).
2.) It tells the child who wants the negative attention that they'll get their attention (because obviously something's wrong), but not right this second. We'll get to the bottom of it in just a minute… and handle the consequences (if any) accordingly.
I've been using this method for years, and it works wonderfully… so much so, that from 1/2 way through the year to the end, I rarely have to send anyone to the "step-aside" chair….and learning can continue at a great pace.
Go ahead and try it… I think you'll like it!