Where do you get these attacks?
One of the recommended ways of dealing with anxiety is called 'exposure therapy' where you intentionally expose yourself to anxious situations. After repeated exposure, the anxiety becomes much easier to deal with, as you can tell yourself "I've been through lot's of anxious situations before, I can get through this". You should not try to avoid anxious situations, because if you avoid them long enough you will start to believe that you can't handle them, and you will continue avoiding them creating a self-fulfilling prophecy.
Try not to think "I'll expose myself to anxious situations when I feel more confident", try to think "I'll get more confident if I expose myself to anxious situations.
Hope that helps!