Generally speaking, there are three kinds of people in fiction: the protagonists - those who the story follows and readers are supposed to care about - the antagonists - those who oppose the protagonists in their quest - and the supporting characters - those who play minor roles along the protagonist’s path. The protagonist by nature is the character who spends the majority of the story in focus, but in a well-written story they are not the center of everyone’s attention 100% of the time. There must exist some sort of balance between a character’s importance to the story and how many words are focused on them. If you’re writing a piece of fanfiction, you’ll be working with characters who have established roles and levels of importance that your readers will expect you to at least acknowledge and respect even if you intend to put the spotlight on somebody who is normally in the background or your original character.
Little Miss Mary Sue does not respect the balance of story roles and time spent in focus. She often spends so much time as the star of the scene and primary topic of conversation that nobody else gets a chance to contribute to the plot in a meaningful way.
I don’t mean to discourage you from inverting character roles for a fanfiction; on the contrary, I have seen plenty of superb fanfics that give the protagonist role to a background character and don’t involve the canon’s main characters beyond brief cameos or small supporting roles. What I am attempting to warn you away from is creating a disconnect between a character’s stated importance to a story and how important they actually are. Do not claim that Sherlock Holmes is a main character when he spends the entirety of your story loafing around in 22B Baker Street while Inspector Mary Sue does all the legwork and deduction.
To demonstrate how to fix issues of role balance, I’m going to use a character of my own that used to hog the spotlight in my original fiction, among many other Mary Sue-ish traits. He’s gone through a few name changes over the years as I’ve fixed him up, but for this and future “Redeeming Little Miss Mary Sue” articles I’ll call him Traev. I created Traev as a catalyst to change what had been a short and moderately balanced story about three middle-school kids, three mythic creatures, and a curse into an epic globetrotting adventure. Traev had magic to rival the best wizards of Lord of the Rings, a massive collection of books on esoteric topics, a handheld supercomputer that could analyze more stuff than a Star Trek tricorder, and very detailed knowledge of the state of the wider world. My original three protagonists on the other hand… Well, one was a ghost soul-bonded to the second and the third was my first-person narrator; they had nothing to make them particularly useful or relevant to Traev’s quest and yet the guy dragged them along anyway. The trio mostly just stood around watching and listening to Traev.
So, how did I fix this? I started out by giving the other three characters special talents that let them contribute to fights, and then setting limits on Traev’s magic. Once I had a better balance for action scenes, getting Traev to share the spotlight in other parts of my stories involved removing, altering, or calling out many of the traits that made him too perfect. His knowledge regarding the antagonists and MacGuffins was among the first things to go, because if the hero knows exactly what needs to happen and how to prevent anyone from causing significant interference, the story’s not going to be much good. The character that Traev morphed into as I worked on him, now named Ash, is still a central figure in my planned stories and has a tendency to act like the most important guy in the room, but that tendency is something other characters are aware of and react to in both negative and positive ways, and narratively he shares importance and “screen time” with the other three main characters: Ray, Rachelle, and Carmilla.
Most of what makes a Mary Sue a Mary Sue is best fixed in the planning stages, before you’ve written most of your story. The balance of role and spotlight time is one of those things, but also one that can be difficult to notice until you’ve written your first draft. You can catch the problem early if you ask yourself things like how many events you’re designing around each character and if anybody has skills, powers, or knowledge you’re over or under utilizing. If you’re writing a fanfiction where your original character teams up with the canon hero(s), play it safe and don’t allow your character to perform any special action that the canon characters already have covered. Instead, find something the hero(s) tend to lack and have your character specialize in that. Try to set up situations that characters other than your original creation are best suited for, and if the canon has a habit of always giving the final blow to a particular character (such as Sailor Moon), do not steal that final blow under any circumstances. Treat existing roles with respect, and your readers will be more likely to respect your original character.