If you want to stop panic attacks for good, confronting them head on is the most effective way. Rather than fighting against the attack, allow it to come and run its course. To put it another way, ride out the storm of an anxiety attack.
This is advised for two very important reasons.
1) The first is that fear begets fear. The more you struggle against and attempt to prevent the anxiety attack, the more fear you'll produce. Fear actually feeds on itself and causes the attack to become even more intense.
Yet if you confront the attack head on, it gradually loses its force and energy because it has nothing to feed off. A good analogy of this is riding a roller coaster. You may have noticed that fear and anxiety grow the more you resist and struggle against the movement of the ride. But, as you go with the flow of the ride, the more enjoyable the ride becomes.
There's an old saying, what you resist persists.
2) The second reason is that the more you try to steer clear of or escape the anxiety attack, all you are doing is avoiding the consequences until the next episode.
But, if you confront the attack, accept it for what it is and ride it out, you'll discover that there actually was no real danger to fear or worry about. You'll realize that your worst fears weren't grounded in reality. No harm came upon you at all.
The more you face your attacks head and come out unharmed and okay, the more you'll come to realize that your worst fears are just the product of your thoughts, not a real, clear, and present danger.
This knowledge will help you to see your attacks for what they are and will give you the faith and nerve to face future episodes. Eventually, you'll know how to stop panic attacks for good.