Going for a walk, although that may not work, or listening to happy music. I had a panic attack in french class and it was awful...
I've suffered from panic attacks for 6 years, and one thing I can say is every solution is easier said than done. For the most part it's not about stopping it once it starts, it's about learning to stop it from escalating until it's over.
make some humor about it: imagine all the people in class have balloon heads and your popping each one until you calm down
imagine youre in a happy place, and think that youre ok, and slow the breathing as you imagine in this beautiful place :) happy thoughts
Take a deep breath and release it slowly... Everyone says it, but it works! Especially when you have to deal with the idiots in your class...
You need to take deep breaths when they come in. Start by counting to two while breathing in and release it after four counts. Then build up to holding it for four seconds and releasing it until eight counts, repeating this while growing the intervals in twos. Do this until you've calmed down and then, if you can, go home and make yourself some tea. :)
I close my eyes and focus on breathing. if its nighttime going to sleep works well.
I agree with Natasitsa
Reading a book, listening to music or going for a short walk are good stress-relievers.
I take deep breaths and try to slow down my breathing