Lesson #001 I've Learned as a Teacher
Okay, so this is both extremely common sense, but also really important to remember because it's EASY to forget. Don't ever, ever, get into a battle of wills with a student. Your job is to be the adult in any situation. This means no matter how stubborn the student, no matter how frustrating, getting into a fight — it can be physical (as I did accidentally, when trying to take away a toy a student was playing with) or verbal, as I thankfully have never done but I've heard other teachers do - is a surefire way to lose control of the classroom.
When teachers are in a classroom and a student decides to defy your authority, don't get into a 'I'm the teacher, you have to do it.' For me (with private school kids, who are waaaay more concerned about their grades than normal kids, or so I've heard, but I have no real experience with), I make it very clear that they are responsible for their own learning. If I have a student who's refusing to write, I simply say, "Don't be surprised if your grade suffers; this is what I'm grading today. You must get it done before class is over. You may not take it home as homework."
Don't get sucked into battles of wills with students. It brings you down to their level, and not only that, it lets them know you can be baited into a fight. We're, of course, all human, so it may happen eventually. The minute you notice you are in this battle, disengage. Leave it, with the words like "you know, (name), do you want a drink of water? I want a drink of water to calm down." Back away from the confrontation, and regain your cool.