Cognitive-Behavioral Therapy (CBT) is an umbrella term for several approaches of psychotherapy. As its name suggests, its aim is to change the way your mind reacts to certain stimuli. Some approaches are focused on changing physical behavior, while others tend to focus on thoughts completely, known as cognitive restructuring. Both approaches have been shown to work well for those who experience anxiety attacks.
For most forms of CBT, the patient is requests to journal thoughts and feelings they have when significantly stressed. This allows them to take a real look at what's going on, question why their thoughts happen like that, and figure out how to change them when the thought processes are not beneficial. From there you can try to alter the disempowering associations that you find.
It can also help just to know what is going on as once the mystery is taken out of the symptoms they aren't as scary anymore. It can remove the victim mindset and move you to focus more on the solution.
Exposure therapy exists under the umbrella of CBT and it is highly effective when dealing with anxiety attacks. When repeatedly exposed to anything, a person can get used to it. Usually you'll start with a diluted portion of the fear as you learn to deal with it in a constructive manner. Gradually you may build up until the fear is completely eliminated. This is part of the reason that anxiety attacks will get worse when a person begins to avoid the situations that seem to cause them.
Often a fear of the attacks themselves will start popping up after you have them, thereby making the attacks stronger in intensity or longer in duration. This means you will need to overcome both this fear and the original one.
There are different types of exposure therapy you can use based on the type of fears you have. Physical exposure helps if you find yourself overly worried about any particular physical reaction during the attacks. This exposure has you simulate or match a physical reaction in a controlled environment to give it a new association. Common fears during anxiety attacks include heart palpitations and trouble breathing.
The other exposure commonly employed in this situation is known is imagined exposure. A fear can be too high to approach directly in some cases. Visualizing the exposure is an alternative. You should envision yourself facing the stress and dealing with it in a calm and decisive manner. You are essentially creating a picture of who you want to be and how you'll look like once you become that person. This works by gradually creating new associations and guiding your subconscious to make this real.
Images are the primary fuel for the subconscious mind. It forms better connections with things that seem tangible. Distinguishing between reality and what is imagined is the job of the conscious mind. As a result, these visualizations will work just as well for your subconscious mind over time as the real thing would.