"Who can say, "I have made my heart clean, I am pure from my sin?" Pr 20:9
The answer to the question is "No one!" Purifying our hearts is not within our power. No one can claim that he has, by his own efforts, attained moral perfection and is therefore acceptable to God. Only the self-deluded can claim this. This ought to humble us all and cause us to look outside of ourselves for help.
And that help, that cleansing can only come through faith in the shed blood of the Lord Jesus Christ.
Ac 15:9 "and made no distinction between us and them, purifying their hearts by faith (in Christ).
1Jo 1:7 ... the blood of Jesus Christ His Son cleanses us from all sin.