Hey there :)
Panic attacks are horrible, aren't they? It's important to remember that even though they feel terrible, they can't hurt you.
Firstly, panic attacks occur as a result of our brain perceiving danger and instigating the 'fight or flight' response. This is natural and has helped humans survive danger in the past. There is one problem though: the danger in the past (e.g. a wild, aggressive animal), is no longer a threat to us nowadays, but we still get panic attacks when we are very anxious.
Next, understand what happens when you have a panic attack. There are 3 main factors that affect panic attacks. They are your thoughts, feelings and behaviours.
What do you think triggered your panic attack? If you don't know, start keeping a record of when you get a panic attack and what you were doing, thinking and feeling at the time. A lot of the time, panic attacks can occur as a result of anxious thoughts. We might worry what if someone judges us, what if we do badly, what if we make a fool of ourselves etc. These what if's, are largely untrue but we focus on them and we increase the anxiety. It's helpful to challenge those thoughts and create more realistic ones instead. Instead of worrying about someone judging you, realise that most of the time, other people might be absorbed in whatever they are doing to notice too much. Even if they were judging you, you wouldn't know and they should still treat you with respect that you as a human deserve.
You might also notice physical symptoms of anxiety too. A racing heartbeat, shallow breathing, feeling hot, maybe even detached and 'unreal' are symptoms of panic attacks. Noticing these symptoms and realising that they are just physical feelings, and that you aren't going crazy or going to die will help. Perhaps you could look online for some deep breathing exercises to practice too.
Anxiety can affect our behaviour too. We might start avoiding people or places that we associate with higher levels of anxiety and panic attacks. Try not to do this as it may only make matters worse.
We may worry a lot about different things and when this worry builds up, it can trigger panic attacks. Journaling your emotions and taking time to look after yourself will help. If it's possible talk to family, friends and your doctor about your feelings and seek counselling to prevent panic attacks in the long term.