I often think my drinking was mostly about an effort to escape chronic low confidence and low self-worth. During the time alcohol still worked for me, it loosened my extreme inhibitions and gave me artificial confidence. Of course, in the long run, it relentlessly stole away exactly what I thought it was giving me.
As for when things started to get better, it took a while. My confidence is still by no means secure. I have periods when I feel what I like to call the "Three Ns" — iNcompetent, iNadequate, iNferior — but overall things are slowly getting better. No matter how dark things got, I hung onto the knowledge that drinking would only make them worse.
As for how, early in recovery someone told me "in order to feel self-esteem, be esteemable." Part of my work in sobriety has been to try to live in accordance with the principles underlying AA's 12 Steps, which boil down (at least superficially) to a constant effort to "do the next right thing."
I also recognize that feelings aren't facts, and even though I may feel low about myself, I can at least try not to believe the feelings.
Lastly, you don't mention how long you've been sober, but I know that for me at least, it took a while for my brain chemistry itself to settle down and stabilize after I quit drinking. The phrase "emotional roller coaster" is used often, and while my roller coaster didn't have many highs, it certainly had plenty of lows in early sobriety.