If your reader or editor says there is a Mary Sue character in your writing it isn't a good attribute. So what is a Mary Sue character, you might ask? Oddly enough the women written in The Original Star Trek series were Mary Sues. It was 1972 and not many women were screenwriters. The men wrote what they idealized in their women without actually writing them based on women they knew or (gasp) having a woman write the women's parts. (They still struggle with this aspect in Hollywood. If you would like to look up some depressing modern day statistics look no further than the employment rate of men to women in the film industry.) Thusly, many of the female characters we see in the beloved Star Trek: TOS are flat, one-dimensional characters. She has no known flaws, is beautiful, and rarely holds a leadership position.
I am aware that the woman in the upper right is not of Star Trek TOS, but I digress.
If you do have a Mary Sue (or a Marky Stu as it were) ask yourself if the character is actually valuable to the fabric of your story. If they are then make them more human! I don't mean an extension of your best qualities either. Give them tempers, jealousies, insecurities, bad habits, anything that could make them more relatable to your readers. Don't forget the reason why readers read. It's often to escape from their reality. If a fiction character is perfect in every possible way it will only make the reader feel worse and dissatisfied with their reading material. Don't lose your readers. They are the biggest fans you have. Show them a relatable character and how that character adapts to their struggles. Give your readers hope.