I get those too and hate it. Some things that have helped me deal with it -
1.) Know that nothing bad will actually happen. You may feel like you can't breathe, but even if it was true, the worst thing that would happen is you would pass out and start breathing again.
2.) Those bad feelings will pass. All you need to do is be patient. Give your body time to get it out of your system. The more you tell yourself not to get them, the worse it can become. Give your body permission to have the attacks if it needs them, for whatever crazy reason.
Once you get over the fear of having them, they will get less and less over time. You can get caught up in a loop where the fear of getting them causes it, so you need to break out of it. Just accept the attacks as a nuisance, but not something you really care much about. You are much bigger than the attacks.
3.) Focus on staying calm and relaxed. I often imagine myself doing something or being somewhere I really like when I get panic feelings. It makes me feel more relaxed almost instantly and things get back to normal quickly.
4.) If it is bad enough you should get professional help.
5.) You are not alone. Millions of people get panic attacks. Based on people I know who also have them, it tends to be really smart intelligent people who get them the most. I don't know why, but maybe our minds work too hard and cause it. A small price to pay for being smart.