Bismillah wa assalaamu alaykum.
The other day I took a bag of potatoes in order to prepare breakfast and found that there was a bad potato that had made the potatoes near it start going bad. Yet again there was a powerful message from Allah in that bag of potatoes. One bad potato will eventually turn the whole bag bad.
Consider how Allah tells us to only keep good companions and that we are on the Deen of our companions. He doesn't tell us to have mostly good companions and a few bad are okay. Neither does He say that if there are many good companions then it's okay to have just one bad one amongst them.
Now, obviously, we need to deal with the bad potato. We might cut off the bad part and use the remainder, but, most surely, we separate it from the good potatoes. This is much like life, where we do our best to handle bad people well and bring out the good, but do damage control and keep our distance.
Subhaanak Allahumma wa bihamdik, laa illaaha illaa ant, astaghfiruka wa atoobu ilayk.