While I sometimes I have problem students who do not conform to my expectations readily, usually, my classroom runs smoothly. Shhh... don't tell anyone else, and I will share my secrets with you!
The #1 way to keep your classroom under control is to have a well organized plan for the day. Know exactly what you want to accomplish, how you want to accomplish it, and what materials you need in order to pull it off. Don't wait until the bell is ringing to whip off copies. Don't wonder what to do if the activity takes less time than you thought. Always have a backup plan in mind. It is said that a dog can smell fear. Students can smell disorganization. Its scent spurs them to churn and churtle. Don't let it happen in your classroom! A few extra minutes spent planning will make your day smoother and easier.
Teach students your expectations and expect them to meet them, every day, every hour. "But in Mrs. Smith's room we can.....
Keep it fast paced and interesting, shifting from something quiet, to something active, always changing things up. Realize that all students learn differently. Some work better with a partner, some work better alone. Some like music, some like quiet. Try to meet the needs of all with varied activities.
Have a sense of humor in all that you do. One boy I had asked repeatedly to be quiet once day responded, "I bet you want to strangle me don't you." I laughed and responded, "Do it yourself so I don't have to!" He wrapped his hands around neck, made gurgling noises, bugged his eyes out. We all laughed, he settled down to work, and all was good. That kind of good natured teasing and rapport with students goes a long way in keeping control.
When faced with defiance, repetition can be a lifesaver. Do not argue or engage the student. Simply and calmly repeat your request, wait time, repeat your request, wait time, repeat your request. By this time, most students will have complied, and you can move on without engaging in battle.
The last and most important trick is to be human. Allow yourself to make mistakes and allow your students to make mistakes. Mistakes can be laughed off, and learned from. Let your students see you as you learn and grow from your own debacles and they will be more likely to take their own in stride.
A classroom should be a home, a place of comfort and consistency, one you and your students all enjoy being. Don't let managing it manage you!