“If they treated me badly, why do I still want them?”
Because knowing someone wasn't good for you and being emotionally attached to them are two different things.
You may still remember the moments when they made you feel loved, understood, wanted, or safe. Your mind doesn't simply delete those experiences because the relationship also hurt you. You may also miss the familiarity of having that person in your daily life — their messages, conversations, routines, and the feeling of having someone there.
Sometimes, you may even be attached to the potential of the relationship — the person you hoped they would become or the relationship you wished you could have had.
There can also be a strong emotional pull when a relationship has involved periods of closeness followed by hurt or disappointment. The good moments can make you keep hoping that things will return to how they were before.
So wanting them doesn't necessarily mean “they were right for me.”
It may simply mean:
“I became attached to them, and I'm still grieving the relationship I wanted.”
Before acting on that feeling, try asking yourself:
“Do I miss this person as they actually were, or do I miss how I felt during the good moments and what I hoped the relationship could become?”
That distinction can help you understand your feelings without allowing the feeling itself to make the decision for you.