Purification of the soul and its cleanliness is conditioned by accounting it.
Thus it will never be cleansed, or purified, or rectified; except by taking it into account.
Al-Hasan [al-Basri] rahimahullaah said: ‘Surely the believer – you will not find him except that- he is in check of his soul: ‘What did you intend with that statement?’ ‘What did you intend with eating that?’ ‘What was you goal in entering such and such place, and leaving such and such place?’ ‘What did you intend with this?’ ‘What is for me with this?’ ‘By Allaah, I will never return to this.’ And the likes of these statements.
So the one who takes his soul to account: he looks into its shames [its deficiencies], and its destroyers.
Then, he is able to tread upon rectifying it.
Source: Madaarijus-Saalikeen of Imaam Ibnul Qayyim