This would make a great procedure (Harry Wong). Count to five or hold up one finger at a time when the class needs to refocus. Discuss what occurs for each number at the beginning of the school year and eventually the reaction will be automatic.
I typically line kids up by calling girls first then boys, or vice versa, just to avoid a stampede. A few times, I’ve had a volunteer parent or newbie substitute … or one time a middle school teacher… call my class to “line up!
My teacher uses a Noise Meter similar to this one. The Noise Meter is a cool way to remind students the correct noise level that they should be using! You just use the paper clip and move it to the appropriate noise level the students should be using.