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.