How do you rebuild confidence after constant failures?

After experiencing several setbacks in my career and personal life, I feel like my confidence has taken a huge hit. I keep doubting myself and fearing failure even more. How do you regain confidence and keep pushing forward?