as a pp says, you learn people rarely think of you at all! They think of themselves and perhaps their immediate others.
CBT helps. Look up online self-compassion and self acceptance workbooks.
Also, learning to identify the different kinds of unhelpful thinking. e.g 'I always fail to... Or I never cope with... You learn to recall times when you were competent.
Affirmations help. and 'wedge thoughts' or 'bridge thoughts' which are halfway between what you currently think and feel and how you;d like to think and feel.
e.g. Right now it might feel impossible for you to believe a thought like, 'i am confident and depend on my own self-worth, not validation through others' so instead you add amid-way thought:
"Right now I rely too much on validation from others but I am open and willing to change this so I can be more confident in my own self-worth. I am working towards not worrying what others think of me.'
A CBT game to play is, if someone cuts you dead in the street or glances your way and then turns back and laughs, to think of all the reasons they might have done that other than because they think badly of you.
Cut dead in the street - may be in a hurry, not wearing their contact lenses, deep in thought, having a bad day and unable to socialise, very shy with people they don't know too well.
The laugh: they're laughing at a joke and happened to glance round. They are happy, they saw something near me that made them laugh, they laugh nervously.
If you are badly treated by others who seem to enjoy cutting you out or dropping you, you soon learn to ask yourself - is that the kind of person I choose for my life? No, so I am glad they are backing away. I don't need to do anything, except politely decline any attempts by them to mix with me in the future. Use neutral language, so you don't overdramatise everyday social interaction.