I have always dealt with low self esteem; it will wax and wane. even though I know people care about me,I still shortchange myself. Now as I enter the fall of my life and finding myself alone,at times it seems hard just to carry on.
Hope you find a path to a happier mental state.
As you are a member of this site, I am going to assume you are a rational person who values facts (things that can be demonstrated) over faith (belief without evidence). In my biased opinion, that places you in a better mental position then the majority of people who incorrectly consider faith a path to finding truth.
I pity the faithful and have witnessed much physical and emotional suffering as a consequence of their faith. Although I currently don't need this perspective, to look out at the delusional masses and realize I am not a member of that mind-numbing belief system would give me great solace.
Focus on your accomplishments and good personality traits. Let any shortcomings or mistakes vanish from your memory. Keep going forward with more stock in the positive and giving no attention to the negative. If nothing else, you'll feel happier alone AND be more of a joy to be around for other people. In doing so, you might cultivate new interests and new companions to enjoy life with. Don't put expectations on yourself, and don't encourage expectations from others. Give yourself a break and be the best you can be with what you've got.
I used to mentally beat myself up about my shortcomings, was never successful in correcting them, but the older I get the more license I give myself to accept them as they are and pay them no more attention. I've got lots of positive things working for me, if I let the negatives overshadow them, they disappear. But letting the positives shine, I'm so much happier.
Hope the same strategy might work for you.