The Second Book of Chronicles records that Josiah was eight years old when he became king. In the eighth year of his reign, he "began to seek the God of his father David" and in the twelfth year of that reign he began a program of destruction of Baalist altars and images throughout Jerusalem and Judah according to 2 Chronicles 34:1-3. The Chronicler records in detail the execution of this program. In contrast, the account in 2 Kings begins with a restoration of Solomon's Temple in Jerusalem, which both accounts say was initiated in the eighteenth year of his reign.
Josiah ordered Hilkiah, the High Priest, to use the tax money collected over the years to renovate the Temple. While Hilkiah was clearing the treasure room of the Temple, he allegedly discovered a scroll described in 2 Kings 22:8 as "a scroll of the Teaching" and in 2 Chronicles 34:14 as "the book of the Law of the LORD given by Moses". The phrase "scroll of the Teaching" (Biblical Hebrew: ספר התורה, romanized: sēp̄er hat-torā) in 2 Kings 22:8 is identical to the phrase used in Joshua 1:8 and 8:34 to describe the sacred writings Joshua had received from Moses. The book is not identified in the text, but scholarly consensus holds that this was either a copy of the Book of Deuteronomy or a text that became a part of Deuteronomy.
The story of the Temple restoration is based on those ordered by an earlier Judean king, Joash in 2 Kings 12, who ruled c. 836 – 796 BC.
Hilkiah brought this scroll to Josiah's attention. Josiah consulted the prophetess Huldah, who assured him that the evil foretold in the document for non-observance of its instructions, would come, but not in his day; "because", she said, "thine heart was tender and thou didst humble thyself before the Lord". An assembly of the elders of Judah and Jerusalem and of all the people was called, and Josiah then encouraged the exclusive worship of YHWH, forbidding all other forms of worship. The instruments and emblems of the worship of Baal and "heavenly host" were removed from the Temple in Jerusalem. Local sanctuaries, known as high places, were destroyed from Beersheba in the south to Bethel and the cities of Samaria in the north. Josiah had pagan priests executed and even had the bones of the dead priests of Bethel exhumed from their graves and burned on their altars. Josiah also reinstituted Passover celebrations.
According to 1 Kings 13:1–3 an unnamed "man of God" (sometimes identified as Iddo) had prophesied to King Jeroboam of the northern Kingdom of Israel (Samaria), approximately three hundred years earlier, that "a son named Josiah will be born to the house of David" and that he would destroy the altar at Bethel. And the only exception to this destruction was for the grave of an unnamed prophet he found in Bethel (2 Kings 23:15–19), who had foretold that these religious sites Jeroboam erected would one day be destroyed (see 1 Kings 13). Josiah ordered the double grave of the "man of God" and of the Bethel prophet to be left alone, as these prophecies had come true.
Josiah's reforms are described in two biblical accounts, 2 Kings 22–23, and 2 Chronicles 34–35. They began with the ending of ancient Israelite religious practices, and the astral cults that had become popular in the 8th century, and led to centralisation of worship in Jerusalem, and the destruction of the temple at Bethel. Some scholars have rejected the entire historicity of these accounts, while others have defended the historical existence of a religious reform under Josiah's reign.
According to the later account in 2 Chronicles, Josiah destroyed altars and images of certain pagan deities in cities of the tribes of Manasseh, Ephraim, "and Simeon, as far as Naphtali" (2 Chronicles 34:6–7), which were outside of his kingdom, Judah, and returned the Ark of the Covenant to the Temple.