Cognitive behavioral therapy is generally viewed as the most effective form of treatment for panic attacks, panic disorder, and agoraphobia. Cognitive behavioral therapy focuses on the thinking patterns and behaviors that are sustaining or triggering the panic attacks. It helps you look at your fears in a more realistic light.
For example, if you had a panic attack while driving, what is the worst thing that would really happen? While you might have to pull over to the side of the road, you are not likely to crash your car or have a heart attack. Once you learn that nothing truly disastrous is going to happen, the experience of panic becomes less terrifying.