I have a sister-in-law who has caused nothing but trouble for almost 17 years, despite helping her beyond what any other person should or would do. In previous times I hated her with a passion, and may I be forgiven, even wished her dead claiming the world would be a happier place without her. This may be a cheater's way out and a cop-out, but I avoid her, and have not spoken to her in over a year. I am happier for it. But I do pray for her, because she lives a miserable life, driving everyone away. She doesn't realize this though. I think it is her karma working. Not only do I think her karma from previous lives or existences (I come at it from the Hindu perspective) is at work, but actions we perform in this life can bear immediate fruit. John Lennon wasn't off the mark "Instant karma's gonna get you... "
All that said, what I try to keep in mind are a few verses:
Whenever I see ill-natured beings, or those overwhelmed by heavy misdeeds or suffering, I will cherish them as something rare, as though I’d found a priceless treasure. - v.4 Eight Verses of Mind Training, Geshe Langri Thangpa.
Even when someone I have helped, or in whom I have placed great hopes mistreats me very unjustly, I will view that person as a true spiritual teacher. v.6 Eight Verses of Mind Training, Geshe Langri Thangpa.
One who is not envious but is a kind friend to all living entities, who does not think himself [entitled to special rights] and is free from false ego, who is equal in both happiness and distress, who is tolerant, always satisfied, self-controlled, and engaged in devotional service with determination, his mind and intelligence fixed on Me, such a devotee of Mine is very dear to Me. He for whom no one is put into difficulty and who is not disturbed by anyone, who is equipoise in happiness and distress, fear and anxiety, is very dear to Me. Bhagavad Gita 12.13-15
"Compassion is that which makes the heart of the good move at the pain of others." - The Buddha
"May I be gentle-minded, cultivating the six paramitas, and never forget bodhicitta. May I completely cleanse without omission every negativity and all that obscures this awakening mind." - from Samantabhadracarya Pranidhana