To have a pure heart, follow the following advices:
1- Trust Allah, and believe that he will never let you down.
2- Be pious.
3- Do not hate any body, even if he harmed you.
4- Always look to the positive part of the things, not the negative part.
5- As you mentioned, keep your heart free of animosity, as it is a main factor for destroying the piety in the heart.
6- Do not misunderstand the people.
7- Free your self from ruthlessness.