As for me I think what happened to me at 5 shaped the kind of person I became. Very short & sweet I didn't dare wake up the 'rents who in bed with a hangover (and it was approaching lunch time) so I figured out how to use a chair and some utensils to pry out a box of Cheerios from a cabinet and make my own breakfast. A feeling filled me then that no matter how scary and unpredictable the adult world was I could take care of myself and in so doing I felt less need for their approval and thus cared less about their judgments of me (and by extension to accept myself even when society didn't approve).
And it seemed no matter where I was growing up I had people shunning me at best and bullying me at worst. For the most part teachers let me read & write quietly (even when other kids weren't allowed to) in exchange for my not asking questions. I was known to be easygoing and not hold grudges for long yet there were enough experiences that showed if you crossed a line in the sand I'd make them regret it while showing my usual not-caring what the adults or popular kids thought of my self-defense and/or retaliation, so with a few notable exceptions they didn't push me (but most didn't accept me either). And I always had friends, sometimes just one (with a few acquaintances) and that was enough, I preferred quality over quantity. That really helped me to accept who I am as well.
That's all well and good for me, but others didn't have those experiences and thus have a much harder time accepting themselves. To them I'd want to say 2 things:
First, not everyone is going to like you no matter how much you live up to the society's expectations. Even if you become popular and successful people will still hate you, for jealousy if not for a more valid reason (sad thing is many become popular or successful at the expense of others so there are valid reasons for people to dislike them). So I think it makes sense to focus on those who like and accept you rather than those who don't and know that no matter what (including if you were straight) there'd always be people who didn't like you...and to be glad that if someone dislikes you just for being gay that they don't have a much more valid reason for disliking you (and IMO you have a much more valid reason to dislike them back).
And two, thinking is a habit. If you're used to thinking everyone will hate your or whatever then practice thinking differently. From others who have done this I know it feels stupid at first but in less than a year (if done at least a few minutes a day) how you think will start to change and feel more accurate than silly and that will inspire changes. For example, many who think they're worthless act worthless because they see no point in even trying and are even too dispirited, but those who think they matter start acting like it and convince many others they matter in the process. Try it, it has worked for others who kept at it long enough for their thinking habits to change, so maybe it can work for you as well.
Anyway, I hope that helps.
mile: