For me, I had a really bad experience in 10th grade that really lowered my self-esteem even lower than it already was before. It was something that I could not talk to my family about, or even my friends. I went through the summer after that dealing with the pain that said experience had caused me, as well as an injury that happened that summer, which put me on crutches for the rest of the summer, giving me time to really reflect and introspect more than ever before because there was not much else I could do. Everything just seemed impossible at that time and I felt so helpless, but then I sort of had a lot of time to think and I sort of had an epiphany and I told myself that that I didn't deserve this and that I was worth much more and that I was going to prove it to myself and I was going to find the answers. So I read the Quran and discovered what Islam was really about and that what people were saying about wasn't true, and that the way my family understood it was polluted by their own cultural ideas. Mind you, a lot of the previous pain and fear that I endured in my life was as a result of racism and identity issues, and while I did grow up in a family with a somewhat Muslim background, I never understood it until I found out for myself what it was all about. Anyways, so at that point, I embraced Islam. I knew that it was the answer to my heartaches. It was just so beautiful to me and practical and made so much sense at the same time. And it helped me realize that I was worth much more than anyone in my life ever treated me like I was worth. So I took all the fear that I had of people and I told myself that I was going to throw it all away. And it didn't come right away all at once, but little by little, I started to take less and less of people's crap and believe more and more that I was a great person and that nobody can change that, no matter what. I realized that I did not want to live my life afraid of everyone and that I was not going to allow people to step all over me and tell me that I'm less than they are. I decided that I had God-given rights and that I was going to embrace those rights, no matter what anyone else believed. And after a year or so, I was a very different person. Two years later, I was an even stronger person. People these days actually come up to me and tell me how inspiring I am, even though they don't know my past and what it took to get here. This includes strangers that I see on the train. The reason is that I'm someone who is clearly different but the self-confidence that I have built is clearly visible and walks with me wherever I go.
For me, it was religion and seeking God and discovering that I wanted to embrace my rights, for someone else, it doesn't have to be. Just realize in one way or another that you are a great person and have a right to be respected and a right to live without fearing other people. Stay humble about it but never lose your self-confidence.