I think you need to have counsel with your heart when that happens to try to understand what you are trying to accomplish by hating and being resentful. In other words, instead of trying to obey "DO NOT HATE!" admit your hatred/resentment, defend it if necessary, and then with a conscience towards GOD ask yourself "What does this accomplish?" You will probably hear your heart say, "I'm hurt". The holy spirit will be there to help you. Be honest.
And yes, it's usually because I'm hurt by the way they treated me. And I have the spirit on hurt feelings too - they are hurt pride. A pride that demands and thinks it has the right to be treated well and with honor. But that's sickening. No man owes me any honor. I think too highly of myself - a little Napolean.