This will take some practice, dicipline and guts but as one who has suffered from panic attacks, I know how badly one wishes them to go away.
This will not be a "Quick fix", as we have to remember the saying: Rome was not buildt over night.
 But I can promise you that if you follow through with this, over time the fight or flight response will start to turn off and the panic attacks will eventually go away.

So what do you do when you start to feel a panic attack coming on? Well my friend, here is the trick; You do nothing. And this is the hard part. To beat something, you have to face it. By trying to avvoid or stop a panic attack, you are actually feeding in to the fight or flight response. You are further teaching your  brain that this needs to be fought or that you need to escape from it. That is not what we want to achieve. 


Here are some steps to take next time you feel the panic arise. 


1. Do not get up to walk around. Imagine you being superglued to the ground. Stay still. 


2. Calmly tell yourself that this is not pleasant but it not at all dangerous. This will pass. It always passes.  Imagine the panic attack to be a wave passing through you. The more resistance you put up, the harder the wave will hit you. 


3. Do not fear the physical or psycologial symptoms. This will take some practice but as you learn to recognize your symptoms of anxiety, it will get easier. Feel your symptoms, sit with them but do not fear them and try your best not to react to them. No one has ever died of a panic attack. Our bodies are well equipt to handle a panic attack. 


4. Do not try to distract yourself from your thoughts. Remember you are not your thoughts. You can just let them float in and out of your mind, without reacting to them. Intrusive thoughts are totally normal in state of panic and this does not mean you are crazy or losing your mind. No one has ever gone crazy from a panic attack. 


5. If your breathing is shallow or you are hyperventilating, let it be. Dont focus on your breath. You will not suffocate. Dont be scared, remeber it will pass and your body is well equpit to tackle this. 


6. Dont be hard on yourself if you dont manage to follow though with this every time. It will take practice, but this is proven to work in the long run. Your amygdala (wich is the part of your brain controlling the fight or flight) will eventually learn from your lack of reaction to the symptoms, that there actually is no real danger. 
But if you feed your brain with fear, you will give it more reason to believe there is something to fear. 
If you try to run from it, fight it or sedate it with medication (like valium or xanax etc) it will turn on your fight or flight response even more, resulting in more anxiety and more panic attacks. 


7. Look at it as exposure therapy. If you have a phobia of spiders, the only way to rid yourself of it is to expose yourself to spiders. 
To beat panic attacks, you need to expose yourself to them. Now as you get more practice you will start to view an oncoming panic attack as chance to learn. A chance to beat it.