First, when entering an unfamiliar classroom, it behooves the substitute teacher to identify the students who are disposed to be helpful. Among the class clowns and the usual discipline problems there are a few who will be able to assist you in finding classroom materials and can help to keep things running smoothly. If you are able to visit with the regular teacher beforehand, he or she will be able to help you identify these students.
Students are always going to try to push the limits when a substitute teacher shows up in their classroom. It is important to prevent this by setting expectations early and assigning consequences when they are not met. As a last resort, you can send trouble makers to the office, thus removing the disruptive influence and allowing the rest of the students to learn uninterrupted. When you set consequences, you must follow-up on them. If you can establish a reputation as a no-nonsense teacher, misbehavior will be less likely to occur. You're not there to be a friend, you're there to instruct and manage a classroom in the teacher's absence.
Discipline will go both ways for a good substitute teacher. It is important for you to stay focused and on-task. Just as you have expectations for the students, the regular teacher will have expectations of you. He or she will have some assignments to be given and will want them to be completed. Deviating from those assignments will likely ensure that you'll not be asked back when another substitute teacher opportunity arises. Don't stress too much if the teacher assigns more work than the class was able to complete. Teachers will often do this to ensure the sub never runs out things for the class to do.
Of course, there are many more things that a new sub will want to know before crossing the threshold of that first classroom. What other simple classroom management tips help you in a new classroom?