@SW-User Consistency is key. Calmness is key (I never shout). I always try to make my lessons as good and interesting as possible. And I tell my students that the same way I give my best for them, I expect them to give their best in my classes as well.
The actual consequences for breaking rules vary. All students are different, and so were the places I have taught in. The important thing is, again, to be consistent. No one can talk him- or herself out of a consequence. Once you have established that you are like a firm, unmovable wall regarding these things, lessons usually proceed smoothly. Children respect these things. And of course they know that I am always approachable about problems they might have.
If you demand diligence and expect excellence, like I do, you better are prepared to offer your students just the same. And if you hold them to high standards, you better hold yourself to high standards as well.