Before you act out of impulse, train yourself to remain calm in situations like these. When you’re confronted with unsolicited criticism from people (especially those whom you don’t expect to hear from at all), understand that you don’t control what others have to say about you. Even if you live a life worth emulating, you won’t always get the feedback you think you deserve to hear. You can’t please everyone, and convincing yourself you are an exception will only burn you out. People will always have something to say, that’s just the way it is.
Pat yourself on the shoulder in the face of failure. That means you’re moving forward. That means you’re trying. That means you’re not in the same place as before. Most people think failure is the end of success which is wrong. The mistakes you’ve made are a manifestation of your commitment to your dream. You’re getting out of your comfort zone and trying out new strategies to attack the problem.
Enjoy failure, especially in your teens. Enjoy the fact that you don’t know everything and you can’t learn everything in a single day. You need people to help you get out of that quicksand. Don’t be stubborn; you’re still learning like everybody else. Either in success or in failure, you need to constantly sweat, bleed, and suffer to grow. The reason you feel like giving up is that you’re still gradually transforming into somebody who can take it. You’re still in transition, embrace it.