Well, they aren't really a secret, I just like using the word 'secret'.
We've all had those difficult classes, the loud, chaotic, too many students, etc.
Here are my tips:
Set the tone.
In the beginning days and weeks, you have to be more stern, that's just the way it is. Don't be too playful. In fact don't be playful at all. You have to show the students that you mean business. The good news is after a few weeks, you can start to give them a little more freedom, and you can be more playful and entertaining in class.
Class start behaviors.
The first thing I do with all my classes is “1,2,3, ABC”. - It's very easy, Teacher says, “123..” Then students say, “ABC”. Then during class when they get out of line, you can say, “123..” And they will respond, “ABC”. It works pretty well.
Line students up outside the classroom. If you can line them up outside the classroom before they come in. (Hopefully they are coming to your class.) Let them wait until they quiet down, then let them in the classroom. While they are in line you can talk to them individually and say “hello” or make general chit chat.
Put them in groups
Put them in groups of 3-4 rows and write their group numbers on the board. Give them stars for good behavior. If group one starts talking too much, take their stars away.
Reward the good groups for good behavior with stickers. Stickers work really well.
Reward good behavior
Try to give stickers or eraser or whatever to good students. If possible buy some cheap candy, trust me it's well worth the investment.
Don't yell at the kids. You'll only lose power - and it doesn't do any good.