Hey. I can totally understand where you're coming from. My high school years were horrible because of my depression and anxiety both. I felt like I just failed everything, which I did only because I was so afraid that I would fail everything. I only had two classes I really enjoyed, that being History and Lit, because those were my elements, and I was really good at them. Everything else I screwed up because I over thought it. I ended up dropping out because of this. You sound a lot like me, so I think I can help you, hopefully. Instead of letting failure get to you, use it to your advantage! Learn from your mistakes. Example, if you fail a math test, memorize the questions you got wrong and their answers, so if they come up again in another test you can answer them correctly. Don't let the fear of failing get you down, either. It's scary, but try to make yourself understand that it happens and isn't anything to be ashamed of. Instead of focusing on the fear, maybe just focus on the task at hand, like whatever class you're in. If you get a question wrong, ignore it as much as possible, and move on to another question. Tell yourself you're going to get the next one right, which boosts your confidence, or hopefully will. As for your anxiety attacks, you should see a doctor. I have major anxiety still, but I've found out that meds can help a lot with it. You just have to find the right ones, because not every anxiety med will help, so if the first doesn't work, the second might, or the third. You should also get some therapy. You don't have to have a therapist or anything (even though this could help you more, but I do understand therapy can sometimes be bothersome, I myself personally don't go to therapy), but you should at least do self-therapy, like learn some breathing techniques that'll help you get through your anxiety attacks (usually it's best to do deep breathing right before you start to feel an attack coming on, that usually makes it easily to get through from what I've learned). Also, figure out what triggers you. From what you've written, I see failure and fear of failure are two of your triggers, so focus on them. Take some tests at home, like ones online that won't bother your real school work. If you get something wrong, focus on it. Think of it, and let the fear take over for a bit, and then you'll have an attack. This is a good thing because when you're having an attack you can then figure out some distractions, like try focusing on another question instead, try pumping yourself up during the attack (saying you're great, you just screwed up and that's fine) instead of pulling yourself down, and also do some breathing to help. Accepting your attacks will help you learn more about them, and how to either prevent them or just get through them much easier. I'm sorry to hear they make you break down and cry, though. That is rough, but like I said, get to know your attacks head on and you should be able to battle them when they happen. Hopefully this will give you some good help :) (also sorry if this was a very long essay, I'm not good at writing short replies xD )
One important thing: the things you mention aren't causing the anxiety attacks, the way you think about them does. The more you do this the more you will do it -- that's how it becomes a chronic problem. Have you ever sought therapy for it so you can learn to break this cycle? This could just be something happening now that will pass, as things do when you're a teenager, but it wouldn't hurt to get a handle on it. Mostly, for some reason you're feeling insecure, which is not only common at your age but pretty much universal. But since it appears to be becoming something that's spreading, I don't think it would hurt to see a psychologist if for nothing else but to confirm for yourself you're okay and will be okay.