I am glad to hear you made it through your appointment and it is ok that you cried, do not beat yourself up. I cry frequently when feeling anxious or stressed out.
The only way you could ever really find a way how to avoid panic attack is if you know when your attacks are likely to occur. Rather than avoid the situation, look at ways in which you can control the attack.
If for example you can feel yourself getting stressed as you enter into a situation, you should start to use calming techniques. Deep breathing is excellent and it is one of the most successful ways to avoid panic attack. As soon as you feel your anxiety getting hold of you, pause and count to ten whilst taking a deep breath in and a deep breath out. Continue this until you feel your anxiety easing away. For many people this technique works really well, but if your panic attacks are slightly more severe then it may not.
Using your medication can be a useful way to avoid a panic attack because medication takes away the anxiety so that it doesn't even occur in the first place.
Overall when looking at how to avoid a panic attack, it is better to think of it more in terms of prevention than avoidance. Avoidance can cause your anxiety to become worse so learning control techniques is definitely a better way to go about it.
Have you ever tried the CBT therapy? It has worked for many people and I am working the online program myself now.
I wish you peace and happiness.