If a Mary Sue is "perfect", then the easiest way to avoid making one is to do the opposite, right? Well, the Anti-Sue shows up when an aspiring writer takes the opposite of "perfect" as "perfectly opposite" instead of "imperfect". A Mary Sue is a Friend to All Living Things who is So Beautiful, It's A Curse and can solve any problem in five minutes or less? Then an Anti-Sue will be The Grotesque and an Enemy to All Living Things who never does anything right. And so on.
Unfortunately, simply inverting the Common Mary Sue Traits does not prevent a character from being a Mary Sue. When other characters still worship them and the plot still bends over backwards to facilitate them they're still a Mary Sue, despite now being described as an unspeakably ugly and incredibly pathetic loser. This can actually be even more annoying than a vanilla Mary Sue at least it makes some sort of sense for characters to worship a beautiful, friendly, hypercompetent Mary Sue, but when they're physically ugly with an unpleasant personality and can barely tie their own shoes (much less solve other people's problems) and everyone still treats them like the greatest thing since sliced bread, Willing Suspension of Disbelief gets smashed into tiny little pieces. (And yet, this is sometimes Oscar Bait for movies about the Inspirationally Disadvantaged.)
Of course, there is an opposite effect. Rather than admiration, some Anti-Sues instead have their peers' intense hatred and dislike of them be what overrides any other plot in the story — that is, they'll drop everything they're doing just to make the Anti-Sue's life that much more miserable and keep them around solely for that purpose, as if they were a walking Jerkass Ball.
Do not confuse with Butt-Monkey, The Chew Toy, or Failure Hero, whose main (but not sole) trait is that they fail at everything. Do not also confuse with Designated Monkey, who is picked on regardless of character traits.