Some ways to help build self confidence are:
Recognize your talents and good qualities and write them down. No matter how down you feel, try to pat yourself on the back a little and remember the things you excel at.
Think of the obstacles that stand in the way of your confidence. Take a piece of paper and write all the things that you think are keeping you from becoming confident, e.g., bad grades, introversion, not many friends, etc. Now ask yourself this: Is that valid or logical?
For example: You didn't get good grades on your last math test, so as a result you're not confident when it comes to your next test. But ask yourself this: If you studied really hard, worked with the teacher, and prepared for the test, would you do better?! YES.
Remember that everyone struggles with confidence. Some people are good at hiding it, but nearly every person has struggled with his or her self-confidence at one point. You're not alone!
Take risks. Sometimes the only way out is through. In order to get good at life, you have to encounter experiences that force you to learn. You can't be awesome at it right off the bat. If you keep doing what you've always done, you'll never get better at...anything. You have to take chances to grow.
Failure is inevitable. It always happens. And it doesn't matter. The only part that matters is that you get back up. Everyone experiences set backs, but not everyone gets back up. It's the getting back up that builds confidence, and you've got to fail in the first place to do so.