O.K. here's some of my thoughts. There has been a lot of excellent advice in this thread from other teachers. I have a lot of teaching experience too, and I've taught various classes including groups that had been classified "unteachable" without any problems. I've handled classes of up to 100 students at one time and I've never lost control of a class. On more than one occasion I've been called in to help other teachers who had lost control of classes and I've always been able to establish order quickly. Now, some of my ideas and techniques may be controversial. I don't care - my success record is outstanding and speaks for itself. I love teaching, it's never a chore for me and it's always fun - and I genuinely like my students and I am quite certain that they usually like me too. My only problems have been with stupid administrators and ridiculous rules, but I usually got away with breaking rules simply because my classes were so successful.
Athon's analogy of sharks is quite appropriate sometimes, although I prefer the idea of a wolf pack. There is a hierarchy to the wolf pack, the wolves will roll over for the alpha male, but if the alpha is shown to be weak, the others will turn on him. You are basically being thrown into a war for social status. Everybody wants to be top dog (including you). The ones that have the strength and confidence to take control end up as the alphas. The others support the alphas because they are implicitly relying on the goodwill of the alphas - in other words by throwing their weight behind the leader they implicitly expect the leader will support them if they are attacked - and that does often happen because if you need to deal with one of the secondaries, the alpha may well launch into you because he sees a way of further establishing his status over you. But, since everybody wants to be top dog, if any of the others see the alpha show weakness then they will make their bid for the alpha role.
Firstly, the most important thing to bear in mind before you can "fix" the kids is to fix yourself.
1. Be enthusiastic about what you teach. NEVER, ever try to "fake it". If you are asked to teach something, study it yourself until you find something interesting about it. No matter what you are given there is always some aspect of it which can be of interest. Your job as a teacher is to find those things and engage the interest of the students. I am a great believer in the principle that teachers don't "teach" subjects but rather they encourage learning. There is a subtle difference between those things that is critically important. You can't force someone to learn, but you can draw their attention to something interesting and explore it with them - hopefully the journey then becomes a cooperative venture rather than an adversarial game of trying to force something on them that they don't really want. In a way it's a sort of marketing - your job is to make the product (the subject being taught) look attractive to the buyers (the students). People don't "buy" boring "products" or things they don't need. So you have to sell it to them by making it look interesting and sexy and desirable. If they start to want it themselves they won't be fighting with you over it - if anything you'll find yourself struggling to keep up with their hunger for it!
2.
What you teach doesn't matter half as much as
how you teach. If you teaching a particular book then it doesn't matter whether they follow and remember every line of the story - look for hidden messages, interesting viewpoints, controversy, challenge - anything that might be exciting about the ideas expressed in the book. Be prepared to diverge. If you are following a novel set in some historical period then go aside to explore the social structure of the period in question and be prepared to show them how that society was both different and similar to today's. Don't be afraid to set the book aside and go off topic - you can always come back to the book. But the first rule to remember is that if
you hate the book and/or the subject, if you are not enthusiastic about it, if it bores you, that will show - and it will bore them. If they are bored they are going to disrupt.
3. The most disruptive students are more often than not the most intelligent and capable ones in the class. It may not seem so, but very often the root cause of disruptive behaviour in the classroom is boredom. They are looking for stimulation. A boring teacher droning on about something that the teacher clearly hates is not going to excite and engage them. So to them they are being subjected to a form of subtle torture and they want to take out their frustration on the cause of that - which of course is you...!
4. Be prepared to "go to war". Psyche yourself up if necessary. Before a class take a few minutes to sit somewhere quiet, take a series of deep breaths, relax and if necessary tell yourself how invincible you are. You are about to enter a battle of wits - so remind yourself that in a battle of wits that you are heavily armed and your opponents are probably not. You have the advantage, you have nothing to fear and you cannot be defeated. Do this as often as necessary so that when you enter the classroom you enter relaxed, calm and self assured. If you genuinely believe in your invincibility it will show and it will place you at an immediate advantage, your opponents will be scared by your apparent self-confidence and it will make them that much more tentative.
5. During a "battle" remember the basic rules of strategy and warfare. Use the time tested techniques of warfare (I'm not kidding!). Remember old adages - the first one to bear in mind is "divide and conquer". You want to undermine the class alpha in front of the others when he acts up. If you work it right, the others will go after him and not you. To begin with, establish who "the enemy" is. Clearly identify in your own mind who the key supporters of the alpha are. The most vocal ones are likely to be the ones who want a shot at alpha themselves. So help them, foment a coup!

In other words, try to make the alpha look ridiculous in front of his supporters and at the same time try to support one of the supporters. This is hard to explain. Sometimes techniques like sarcasm can be extremely effective - if you can find some way to laugh at the alpha, and compliment one of his vocal supporters at more or less the same time, you are shifting the balance of power. Manipulate them. This sounds horrible and will shock some people - but in reality it's a highly effective technique if used judiciously - but remember above all, the objective is not to "destroy" the enemy, don't go too far, all you are trying to do is disarm and disorient your opponents long enough to establish that you are the real alpha. If you do it right, you will find it will only need to be done once or twice and after that your status will go unchallenged.
6. Be firm and inflexible in terms of rules. As others have said here, spell out the rules clearly and unambigiously at the beginning. Make sure that there is a definite consequence for every conceivable infraction. The moment an infraction occurs, apply the well known penalty - there and then, without exception and without any flexibility at all. If they go down on their knees and beg for forgiveness, don't give way, implement the penalty anyway. The idea you are trying to instill is that the rules are absolute and unquestionable (as are the consequences). There is no flexibility in the rules, the rules are sacrosanct, and you are an inflexible enforcer, you can't be bought off by contrition, moved by tears, negotiated with or anything else. You will never give way and you will never stop. You are "the terminator" so to speak.
7. Never ever lose emotional control. Never lose your temper (which doesn't mean that you can't show annoyance, but minimise it). Try to laugh off challenges. For example, take the situation with the remote control. Laugh at it, tell them it was a good joke, but then with a smirk on your face apply a draconian penalty - in a way you're saying to them, "Look, you didn't get to me, I'm laughing, but I'm the one who's going to have the last laugh though because the joke is on you..." Even better actually do laugh at applying the penalty - make it part of
your joke - if the others end up laughing at the perpetrator being punished he's lost status. You want to instill the idea that a punishment is not martyrdom or a sign of status, rather that it's a sign of their own weakness and stupidity. Only fools need to be punished, and fools should be laughed at, not encouraged.
8. Never hestitate. If you don't know what to do next, stall, shift attention elsewhere. If all else fails tell them you have to go to the bathroom and get out the room for a few moments and think of something quick. Try to never show them that you don't know what you are doing. They must have the idea that you are
always as much in control of yourself as you are in control of them. Always act swiftly and decisively. If you make a mistake always apologise and fix it, there and then and move on. Never stubborn it out. For example, imagine you are in the middle of a lesson and one of the students says, "You are wrong about that!". Never ignore the challenge, never say, "Yes I am, just shut up!" Instead turn the heat up on them - turn to the student and ask them to explain why and how you are wrong in front of the class - now
they have the attention and they have to justify themselves, not you. Listen to what they have to say. If they are definitely wrong then try to make them realise their own error by asking pertinent questions, use analogies, metaphors, give them hypotheticals to solve - the more you keep the pressure on them, the less it is on you. If they are right, acknowledge that they are right. Tell the class you made a mistake, apologise for it and thank the person who drew your attention to it. But calmly, and quietly and above all with an air of assured confidence. If you don't know the answer, and you're not sure if you are right, admit it. Tell them you don't know the answer. If it's possible to look it up there and then, do so and try to involve the class in helping you, ask them if they have some source of information, get them involved in searching for the truth. If it can't be looked up there and then and the point isn't critical to the rest of the lesson, then assure them you will investigate further but for the moment just move on. If you can't proceed with the lesson then stop it there and then and find something else to keep them occupied for the rest of the time - i.e. take time out to discuss some earlier point in more detail etc. After the class look up the answer and next day, start the class where you stopped and give them the answer you promised you'd give.
9. Encourage interaction. Encourage questioning, discussion, involvement. Never drone on and have them sitting there bored. Make it clear that you would rather have a lively debate about ideas than simply droning through the subject matter. It's better to have a lively off-topic debate than have them sitting bored and distracted through a bad lesson. The more engaged and involved they are the less likely they are to disrupt. If someone cracks a joke, laugh at it and crack a better one and so on. That's another good point - try to make them laugh every once in a while, have a few quips handy. You should be aiming for maximum engagement and involvement. If there is a student sitting quietly saying nothing, draw them out, point to them and say, "You look like you don't agree, what do
you think of this?" and so on... If they respond with no real answer like, "No I'm O.K. I agree", then probe further, take a devil's advocate position if necessary, criticise your own idea and say, "Come on, surely you must have
some thoughts of your own about this". But don't flog a dead horse, if you can't engage them move on.
9. If you can engage with most of the class, and an alpha tries to disrupt he'll quickly get put put down by the others. If they are genuinely interested they won't have any time for his antics.
10. In a worst case scenario, if you completely lose control then retire to your desk, take a deep breath, sit down and try to relax as much as possible. Let them do what they want for a while, just sit there quietly, calmly and ideally with a slight smile on your face. As soon as they calm down (which they will do pretty quickly because you sitting there like that will unnerve them), apply the appropriate penalty to the whole class immediately. Don't discuss it. Just let them know that certain behaviours cause certain punishments and if they really want the punishment then that's fine with you. Never show remorse about punishments or tell them that you are disappointed or anything like that. Make it clear that you don't apply punishments, punishments are automatic consequences of certain actions and that you don't care about it one way or the other, you're just there to do the enforcing, that's your job and it's not negotiable. The whole key to applying punishment is an air of nonchalance or indifference.
11. Enjoy yourself! Really! Lessons should be fun for you too. If they're not, make them so - you are God in that classroom, you can do whatever you want, so aim to have fun yourself while youre doing it! Never take yourself too seriously and be prepared to laugh at yourself.
12. Apply the same techniques to your collegues if they act up! If you are given a bad lesson plan by someone else, fix it and give them a revised plan back, tell them what works better. Don't be bullied, be assured and confident.
13. No matter how you feel, if you are tired, hung over or whatever, act lively and enthusiastic. Project boundless energy (even if it exhausts you at the end of the day!). But above all don't be like a wet sponge!
14. Try to cultivate the attitude that the lesson is yours. The purpose of the lesson is for you to enjoy yourself, that is your one and only aim - put all other aims out of your mind. You'll be surprised that that actually is beneficial to all and in many ways is one of the greatest facilitators of learning in others.
Those are just some rough ideas that I hope will help. These ideas are based on my own experience and what I have also seen work for others. Above all, don't panic. Treat the whole experience like an adventure and an experiment, be flexible and be prepared to change to meet the circumstances. Don't dwell on failures and worry about mistakes, don't take things personally, instead concentrate on how exciting the next lesson is going to be and how much you're going to enjoy it. It'll take some time to get your stride but treat it like one big game and you'll find it works out very differently.