2 Chronicles 34:2
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. 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.
Josiah did what was right in the sight of the Lord and remained faithful to that course without turning aside. He walked in the ways of David his father, declining neither to the right hand nor to the left. When God's law was read in his time, his life stands as the example of the repentance and return to the Lord that is expected.
His steady obedience was a deliberate choice to honor God and to follow His instruction. He made that choice despite the wickedness around him and despite the sinful examples of his father and his grandfather. His course is a lesson to walk uprightly before God.