2 Chronicles 34:2-3 And he did that which was right in the sight of the Lord, and walked in the ways of David his father, and declined neither to the right hand, nor to the left. For in the eighth year of his reign, while he was yet young, he began to seek after the God of David his father: and in the twelfth year he began to purge Judah and Jerusalem from the high places, and the groves, and the carved images, and the molten images.
Josiah, one of the two best kings, did that which was right in the sight of the Lord. His actions were described as walking in the ways of David. David was the model for measuring the life and reign of the kings. David had a heart for the Lord. This is what counted, what really mattered. Josiah knew who God is, and what He is like, a God of mercy, compassion, and forgiveness. This kind of faith (a heart for God) produces a walk (life and behavior) that follows the example of David.
This kind of godly faith and life led to a purge of anything that is not of God. High places, groves, carved and molten images were torn down and cast out. A heart for God moves one to look for thoughts, habits, words, and deeds in the heart, mind, attitude, and inclination that are not of God and displease Him. Finding and rooting out anything that takes the place of God in the heart is not easy, but the faithful believer persists in daily soul searching and repentance. Purging is a necessary part of daily life that involves confession and forgiveness.