How do people get such good confidence?

I feel like sometimes I have bad days and it fucks up the next couple of days, I don't have that many friends, and I feel like I'm shitty at everything. It seems like everyone feels fine and I feel so bad for myself, it's a never ending cycle of self pity and doing nothing about it
How do people get such good confidence?
Post Opinion