The only (pretty worthless) advice I can give is to lie down.... The only time a panic attack didn't result in me passing out was when I felt it coming and immediately went to lie down. And for whatever reason, how my panic attacks all end is with me getting the dry heaves. After I dry heave, that's when the panic attack subsides.
As for preventing panic attacks occurring in the first place, my primary care doctor put me on paxil and told me to get therapy, so I did both those things and they worked like a charm for me. My doctor told me specifically just doing one or the other will not work, but doing both at the same time works. But of course different people need different things, so what worked for me, might not work for you. And of course you may have already tried all of this and it didn't help much. But that's all the advice I got.