How to Take Care of The Heart

Allah knows everything.

Ibn Hajar Al-Asqalaanee [rahimahullahu] said:- 
"The heart has been singled out because it is the leader of the body and through the purification of the leader... the subjects become purified. and with its corruption they become corrupted. So if you, O servant of Allah, wish to cure your heart then it is upon you to be truthful with regards to--- 
1 Seeking refuge with Allah

2 Putting trust in Him,

3 Pray a great deal of supererogatory prayers,

4 Perform the actions of obedience to Allah frequently.

5 Pray the night prayer while the people are sleeping, and to treat your heart by

6 Making it continuously stick to the remembrances and by 

7 Befriending only the righteous…
and to

8 Frequently recite the Quran.

And Allah will indeed allow all of this to be preserved by Him.