Firstly I don't get panic attacks....I'm that overly chilled out person who people having panic attacks grab onto because I seem unflappable (or wants to date fror the same reason...lessons painfully learned there)...So this is mostly stuff I've learned from people having panic attacks near or at me.

Kinda depends on the type of panic attack...

massive feelings of unease and jumpiness with aspects of catastrophic premonition that lasts for a hour or more doesn't need the same things as claw handed hyperventilation that strikes from out of the blue and leaves you huddled in corner of the lavatory for 10 minute boughts.

Generally helpful advice that I've ended up using:

something to do with your hands...both prevents self destructive bits and helps give you something focus on. which is my next point...

Focus on something...preferably something with multiple steps that has an end....what it is doesn't matter it is more about trying to push your mind through a structured system that also draws focus away from your own feelings of panic...because once you start the attack the "oh no I'm having a panic attack" becomes a reason to freak out ( you doesn't feel in control, it could cause problems at work, and a bunch of other negative aspects that give you things to freak out about...you want to break that)...also it gives you something you are in control of which can also help with panic attacks.

Music...can really help if you actively listen...as in you focus on the listening to the music...it acts as a focus to draw the minds attention (as a big part of the panic attack is likely to be the hopping around of idea a subject if it is more mentally focused)..basically let the music consume every thought you can....I'd generally recommend something more melodic or structured but that's just my experience in having to sit with people doing this...some people like a few classics some like new music they have to analyze (which kind fits into the focus on project idea above)...related to the "focus on my voice" trick bystanders can use.

Drink water if you can....this is something that can backfire if hyperventilating but otherwise often helps...
eating simple food....you know that focus on a process I mentioned above? Finding a packet of ramen or whatever, finding bowl, adding water, microwave, finding fork, and eating is just such a process...and one of my friends relies on this extensively

Controlling your breathing...mixed results in the people around me...
some people find it helps to center them other freak out when they can't control it super quick and it makes them feel more out of control and it just hurts the situation. Go ahead and try it but if it doesn't work don't stress on it.

if they happen a lot try to develop a mental sequence that you can use to train your own brain to tamp down the panic attack...this may be a mix of thought pattern and action...I've seen most success with a mix of breathing patterns, music, mantras, etc...just find something that works a couple times and then let the placebo effect start boosting things...The sequence worked before so if you do X,Y,Z you'll feel better...and while it isn't a replacement for doing any old thing it can really improve a moderately helpful sequence. Basically you are trying to train you own brain to have a "shut down panic" routine...may even help to practice it without panic attacks to calm down in general to get the point accross so that you can hit that button when yo really need it.

Sleep, Exercise, and eat plenty of greens ... does wonders for prevention apparently.....