When you are aware that your heart is ill...
Ask yourself these questions :
1. What is my problem that causes this illness?
After you have known your problem then ask-
2. What is the root cause of this problem?
For example:
If your problem is backbiting. Then you identify the root cause is you cannot avoid backbiting when you're with your friends. Then avoid seeing them to purify your heart.
Because in this life we want less of these 4 things to purify the heart.
1. less talk
2. less food
3. less sleep
4. less engagement
And to add one thing
1. zikr to Allah (remembrance of Allah)
for example looking at nature and said SubhanAllah what beauty is this? or reading Quran or anything related in remembering Allah. The aftereffect of these will make you calmer, grateful and closer to Allah. It is beautiful.