The only way to be clean of heart is to keep the Word of God because it can help us in the most difficult moments, keep us from all the bad things that want to gnaw and enter and cause a total mess in our hearts.
That is why we must remain pure and always holy before God, praying to the Lord to give us strength to overcome temptations. This will help us enough to know everything that is sent by the evil one to make us sin against God.
Wherefore, beloved, seeing that ye look for such things, be diligent that ye may be found of him in peace, without spot, and blameless.
2 Peter 3:14
Peter urges us to work hard to keep ourselves clean and peaceful before Him. That is, that we be pure and firm in the Word and in the ways of our Lord.
If we try to be firm and without crossing out, when the Lord comes He will find us with our spiritual garments without blemishes and we will be taken by Him to the promised, but if He finds any fault, then it will be very unpleasant because there were warnings for us to be firm in the Lord.
Let us take this brief advice so that we may do well, be wise and act with this wisdom that God has placed in each one of us so that God can see us at the time of His coming and that He can find us pure and clean of heart.