There is a saying in Sanskrit, ‘Durjanam Prathamam Vande Sujanam Tadanantaram’. Worship the bad person also. The bad people are ruining themselves so convey your gratitude to them - since at their cost, while falling in a pit and getting ruined - they are teaching you a lesson.