Try to keep a routine in your life so that you can keep panic attacks away. If your life is simple, predictable, and manageable, you'll find that less things get you irritated or worried. If you know what's coming you can handle it when it gets there, so plan it out!
If you have frequent panic attacks, then you should try practicing meditation. This is a simple process where you empty your mind in a quiet and peaceful manner. If you practice meditation frequently, you can learn a lot about your inner mind and how to control yourself when you feel anxious.
Sometimes you just need to walk away. You are in a fight or flight situation during a panic attack and your adrenaline is pumping. Take a walk for a while to burn this energy as quickly as possible. You will regulate your system and slow the production of adrenaline by increasing your heart rate and bringing oxygen to your system quicker.
Sometimes you can stop a panic attack at its onset by trying some different techniques. Purposely hyperventilating can often stop an attack in its tracks. Try drinking hot tea or cold water. Lie down, and close your eyes. Think of something funny to make yourself laugh. Go for a short jog. Keep track of the methods that seem to work, so you can try them again the next time.