How do you handle rejection

How do you handle all the situations where you feel uncomfortable where you have been let down

I'm questioning everything from what is wrong with people to what's the matter with me my boyfriend broke up with me and that made me question what is wrong with me why and what were the reasons we broke up? I question the job why I didn't get hired?

I'm going through life like dealing with this I've had to deal with losses rejection failures and I'd like to hear people who still go on overcome all this what do you do to heal from all of that?