Another teacher once told me that you can't help but play favorites. Yes. You can. You can help it. If you honestly can't help preferring one child's presence over another, at least don't make it obvious.
This is another one of those "teaching is like mothering" issues. I have lots of students who think they are my favorites, but that's because they seek me out instead of the other way around. They come to my room before classes start, they say hi on their way to another class or they stay after school to chat with me. That's always their choosing. Any of my students can chat with me whenever I'm in the building. In a lot of ways, that's the way my mother always did it.
You see, I'm my mother's favorite. Or, at least, I think I am. All three of us think we're our mother's favorite. Why? Because she makes each of us feel life her favorite. She celebrates our differences and appreciates us for who we are as individuals rather than comparing us to each other.
It's simple, but it works. It works with students, too. I would never dream of saying "Why can you be like Sally?" to a student or "Johnny has his work done, what's wrong with you?" Kids get compared their whole lives and they don't like getting compared. The only time they enjoy getting compared is when they are the positive example. However, if one student is the positive example, there inevitably is one student seen in a negative light. The trick is to raise students up without tearing others down. You shouldn't have to shame or badger a student to get them to behave the right way. You shouldn't have to make them cry in order for them to understand you. Playing obvious favorites and comparing students is bullying, whether you want to see it that way or not.
The favorites game is just another way for students who desperately need help, love and support to feel further marginalized. "How will I ever pass this class? The teacher hates me. I might as well give up now." And they do.
There's nothing wrong with admitting to yourself that a certain kid would have been your friend if you were teenagers together. It's natural to look for similarities between you and your students. The problem is when you take a special interest in these students, and only these students. The problem is when you let your instruction suffer because you're letting them get away with everything. The problem is when another student tries to do the same thing and you actually discipline that kid. The problem, in short, is when it disrupts any student's ability to learn and succeed in your class for any reason.