Listening to other people, especially to women, is a skill. Don’t spend silent time in a conversation waiting for your chance to speak or be smart or witty, stay quiet and really process what you’re hearing. Imagine yourself in their situation. Accept that what they say is exactly how they feel.
The less time you spend talking, the more your conversational partner will tell you, and the more you will start to understand them, their lives, their goals, and their anxieties.
Knowing and understanding other peoples’ experiences will help you not only make better decisions in your own life, but understand why other people act and think the way they do. You’ll be less likely to snap-judge or make assumptions about others. And knowing more about your loved ones, co-workers, and neighbours will allow you to help them effectively if they need it.
And travel abroad as much as possible - listen to people from other countries and cultures. The human experience is wildly varied and endlessly fascinating.
A Mary Sue can fail, but those failures don’t usually have a massive impact and are easily reversed without the feeling that the MS had to struggle to earn the reversal.
The more flaws a character has, the more they have to work to balance them out. Readers are more likely on the side of a character that has to work and make sacrifices to make it through the difficulties the plot throws at them.
Random Example: Diana Rowland’s “My Life as a White Trash Zombie”. Protagonist Angel has a criminal record, drug addiction, abusive home life, and generally makes very bad decisions. Because of her life course, she has very few resources (she can’t go to the cops, nobody she knows has money or connections, etc) but she can think quickly and has a sort of desperate resourcefulness. Because everything is working against her, she has to fight for any positive forward movement, and one misstep can be a serious threat - and those happen frequently, undoing any success and forcing her to burn her resources to try a new path. IIRC in one of the books the B-story is her trying just to earn her GED as the main plot around her is utter pandemonium. Just that struggle to graduate high school is a herculean task given the deck stacked against her. Readers aren’t thinking “how will she win”, they’re thinking “well what’s going to go wrong this time?”
TL;DR: If every time your protagonist has a setback the readers shout “can’t she ever catch a break?” instead of “ah she’ll just breeze through this” you should be doing okay.