My general advice for new teachers is always the same: figure out which are your boundaries (which may not be the same ones as mine) and make sure those are not even near being crossed.
Everything else, take it with humor.
For example, I don't mind an snarky remark here and there (they soon learn that they should expect an snarky reply from me though xD) or an out-of-context comment. We all laugh at the joke, then it's over and we continue working.
But I can't stand general background noise. You know, when everybody is talking at the same time, and the place seems a bar.
So I don't wait for it to happen - as soon as I notice they start to talk in that manner, I cut them out.
No need to reprimand them, because we have not reached the boundary yet, just a gentle reminder in a serious tone suffices. "Hey, guys, we are doing exercise 8, right?"
If you let the situation get worse, then you put yourself in a tricky position: either you give up (and you lose their respect) or you scold or punish them (and you lose their sympathy).
So it's better getting serious ahead of time rather than waiting for it to become a problem.
Don't try to be very strict about everything or you'll seem authoritary. Just about the stuff that bothers you.
For example I'm all for silly discussions with my students.
Student: Shit!!
Me: That vocabulary...
Student: Oh, sorry, teacher ^^;
Me: At least have the modesty of saying "poo".
Classroom: WTF.... ¬¬ ^^; XD
Now all the class says "poo" when they have trouble... and I've told them it's terrible, we have the shittiest ongoing joke ever
