Let me add in a disclaimer first and foremost by mentioning that I am no professional and that everyone experiences anxiety and panic attacks very differently. These are just a few of the techniques I have found over the years that have worked for my random attacks that seem to always come at the worst times of the day.
The easiest way I can explain what type of anxiety I have is describing it has something situational. This means that I can get very easily triggered by either event that is currently happening, or my mind likes to convince me that a situation is ten times worse than what it actually is. So if you or someone you know seems to experience their attacks in a similar way, I hope these techniques are useful in overcoming them when they come to you in the worst part of your day.
The first technique that I like to use is what I refer to as grounding. Since most of my attacks come due to specific events happening, I like to establish my surroundings while focusing on my breathing. For example, taking a step back and focusing on little things such as each singular sound around me, things I eat today, and even facial features of the people around me seem to help a lot. I would assume this is a way to distract my mind from the attack and with how weird it is, it often does the trick.
Another technique I have found useful I tend to practice when attacks come in cases where I have been thinking about something way too much. This is most likely the result of insecurities or just worry about failure in general, so to counteract those thoughts, I think about people and hobbies. I make a list of all the people that care about me in my head and remind myself of all of my favorite hobbies. Remembering that you are loved and cared for is a great way to counteract dark thoughts that creep into anxiety attacks, so try to keep them in your mind even in the darkest of times. Hobbies are a good distraction from negative thoughts and ideas, so surrounding yourself with music, art, outdoors, or whatever else makes your heart happy is highly important to your state of mind.
The last technique that I have found the most helpful is always having someone just a phone call away. This is sometimes the most difficult technique to practice, especially when you are already buried deep into an attack of some kind. You feel like a nuisance to anyone at that moment, but try to push past those negative thoughts. Friends and family are always going to be there for you when you need them most, especially when you only surround yourself with positive individuals. Talking about what you are going through in some cases can not only make the attack go away faster but allow all your worries to be uplifted, even if it's only for a few minutes.
I hope that if you or someone you know that finds these three techniques useful will practice them whenever you need them most. Even if you experience anxiety and or panic attacks and do not find these specific techniques useful for your situation, don't be afraid to experiment and find the tools that are the most beneficial for you and your needs.