First take several deep breaths. Slowly breathe in and out. Then try to remove yourself from the situation/trigger/person that is causing the panic attack. Then do something that comforts you, like listening to music or reading fiction.
I have recovered from the panic attack, thanks for your advice, I'll do this the next time I have one. Pardon the very short post earlier, was hyperventilating and couldn't type much because of that. Apparently playing Super Mario Galaxy did it for me, was able to relax a bit.