I know it can be hard to receive feedback on this, so bear with me.
Especially feedback in terms of reading a book and suddenly you'll be cured of this or something.
That said, have you ever read "Learned Optimism" by Martin Seligman?
I read it and worked through it with my therapist probably five years ago and it really helped me to distill down what negative perceptions I had of others or of myself compared to others, and it helped kind of reduce the pessimistic beliefs I had/have about the world and about myself.
I'm of course not saying it's a cure or an end-all-be-all form of working through these issues. But it did help me.
I also should note that I am nowhere near perfect in this matter nor will I ever be, unless I keep working at it, which I am, so I will.
And no one's ever perfect, so perhaps that prior remark was a bit unrealistic. But I'll try to get closer.