Aspiring novelists need to realize that basing a character on the best version of themselves is taking the easy way out. Noah Lukeman, author of several books about writing fiction, admits that authors are allowed some self-indulgence so that they can get the words down and let the work evolve (4). He warns, however, that writers must recognize when they’ve indulged themselves and then go back and focus (5).
I've mentioned "Mary Sue" characters; readers had questions.
Basically a "Mary Sue" character is a new, improved version of the author.
Mary Sue characters are irritating to readers, because they're too good to be true. A Mary Sue character has endless talents; even her/ his faults turn out to be virtues.
If you suspect one of your characters is a Mary Sue, eliminate him/ her. Your book will be all the better for it.