From the perspective of a current sub:
Arrive early so you can:
...look over the lesson plans for the day.
...become familiar with the content/assignment for the day's lesson.
...decide how you will teach the content, if asked to do so.
...find all the materials for the lesson/assignment.
...determine if the work should be collected at the end of the period or kept until the teacher returns.
...determine if you need to collect current homework and go over it before today's lesson.
This will show the kids you KNOW what you are doing and today will be a regular class day instead of a social hour.
Learn as many student names as possible. Students are much less apt to act out when you can call them by name. This is my #1 class mgt tool.
circulate around the room while the kids are working. This is my #2 mgt tool, but only by a very slim margin.
Stand outside the door of your room during class transition time. Other teachers will appreciate an extra set of eyes in the hallway and most kids WILL listen to any instructions you give them (WALK! being the reminder I use most often), even if you are "just the sub."
Collect classwork (if directed) and leave it organized by class for the teacher.
Leave good notes for the teacher about how the day went. I write a brief summary of the material covered and behavior of each class period.
Have a back-up plan in case kids finish the assignment early. In our district, kids should always have a library book with them to read if they finish their regular work. I've also allowed kids to draw, as long as they do it quietly. I also keep a list of riddles, puzzles and other "time-fillers" to use at the end of a class, if needed.
Make sure the room is clean and all equipment and switches are turned OFF before you leave.
Substitute your OWN plans for the teachers. The teacher left the plans for a reason. That is what they want their class to do that day, so stick to the plans as closely as possible.
Listen to the kids when they say "Mr(s) Regular Teacher let's us do X". Chances are, Mr(s) Regular Teacher does NOT allow that at all. Teachers will usually leave a list of students you CAN trust to give you a straight answer, if you need it.
Let kids go to the bathroom, library, etc the first time they ask. I know this is controversial, but you can always say "Not yet" rather than "No". That let's them know they CAN go if they really need to, but will have to ask again a few minutes later. If they DO have to go, they will come back. If they don't really have to go, they usually won't ask a second time.
Let kids work together on the assignment unless the teacher has said they can do so.
Let kids sidetrack you with off-topic comments, questions or actions. Remind them of the work they are supposed to be doing and direct them back to doing that.
Rifle through the teacher's desk for things and absolutely don't let kids do it. Tape and staples are usually on the desk already and kids are supposed to bring their own pencils and paper.
Lose your cool with the kids or let them see you sweat. No matter what happens, remain as calm and "in control" as possible. When the kids see they can't get you rattled, they will usually settle down pretty quickly. Sometimes, it IS necessary to raise your voice to get the attention of the class. That doesn't mean you have to yell or scream. There is a big difference between the two (at least for me). Generally, though, my most effective technique for a class that is too loud is to stop talking at all and sit on a stool or lean against the front of the desk. That let's them know right away they have pushed a bit too far. When they stop talking, I use an even quieter tone of voice than normal to remind them of the behavior I expect from them.