Confidence is gained through repeatedly achieving things that you want.
Working out has been mentioned. It's the easiest way to boost your testosterone and build confidence. But your career is even more important and you'll have to be patient before that becomes a source of confidence.
Don't beat yourself up. You've recognized that your life needs fixing, that's enough. Use the pain to push you towards work now, don't pull yourself further down. That means watch your thoughts.
You likely have many things to fix. Do not attempt to fix everything at once. Pick something you know how to improve. Make a plan with SMALL steps. Break the process down as much as possible. Once you have a plan and start executing I promise you will immediately feel better already. Then it's all a matter of focus and persisting. We all suck at it but those of us who keep trying are the once who eventually get that good good. Do not settle for mediocrity.
If you want to jump start your process I give you a secret tip. Go for a run or a hard hike and go as far and as fast as possible. Get yourself to the point where your mind thinks you can't take anymore and then keep pushing further. You don't know how much you can do until you do it. That's a recipe to gain self-respect fast and hard.
Books I recommend:
Cant Hurt Me - David Goggins (mental toughness. get the audio version, it's brilliant with extra stuff)
Richest Man in Babylon - George S. Clason (basic mechanics of how to become rich. financial philosophies that worked in ancient Babylon and still work to this day)
Finally listen to Arnie talk some sense into you: