Josiah was the son of Amon, and his successor on the throne of Judah (2 Kings 22:1; 2 Chronicles 34:1). His history is contained in 2 Kings 22, 23. He stands foremost among all the kings of the line of David for unswerving loyalty to Jehovah (23:25). He "did that which was right in the sight of the Lord, and walked in all the way of David his father." He ascended the throne at the age of eight, and it appears that not till eight years afterwards did he begin "to seek after the God of David his father." At that age he devoted himself to God. He distinguished himself by beginning a war of extermination against the prevailing idolatry, which had practically been the state religion for some seventy years (2 Chr. 34:3; compare Jeremiah 25:3, 11, 29).
In the eighteenth year of his reign he proceeded to repair and beautify the temple, which by time and violence had become sorely dilapidated (2 Kings 22:3, 5, 6; 23:23; 2 Chronicles 34:11). While this work was being carried on, Hilkiah, the high priest, discovered a roll, which was probably the original copy of the law, the entire Pentateuch, written by Moses.
When this book was read to him, the king was alarmed by the things it contained, and sent for Huldah, the "prophetess," for her counsel. She spoke to him words of encouragement, telling him that he would be gathered to his fathers in peace before the threatened days of judgment came. Josiah immediately gathered the people together, and engaged them in a renewal of their ancient national covenant with God. The Passover was then celebrated, as in the days of his great predecessor, Hezekiah, with unusual magnificence. Nevertheless, "the Lord turned not from the fierceness of his great wrath wherewith his anger was kindled against Judah" (2 Kings 22:3-20; 23:21-27; 2 Chr. 35:1-19). Jeremiah aided the progress of this great religious revolution with his earnest exhortations.
Soon after this, Necho II, king of Egypt, in an expedition against the king of Assyria, with the view of gaining possession of Carchemish, sought a passage through the territory of Judah for his army. This Josiah refused to permit. He had probably entered into some new alliance with the king of Assyria, and faithful to his word he sought to oppose the progress of Necho.
(The above paragraph contradicts the article about the Battle of Carchemish. I don't know enough about this to resolve the discrepancy.)
The army of Judah went out and encountered that of Egypt at Megiddo, on the verge of the plain of Esdraelon. Josiah went into the field in disguise, and was fatally wounded by a random arrow. His attendants conveyed him toward Jerusalem, but had only reached Hadadrimmon, a few miles south of Megiddo, when he died (2 Kings 23:28, 30; compare 2 Chr. 35:20-27), after a reign of thirty-one years. He was buried with the greatest honous in fulfilment of Huldah's prophecy (2 Kings 22:20; compare Jer. 34:5). Jeremiah composed a funeral elegy on this the best of the kings of Israel (Lamentations 4:20; 2 Chr. 35:25). The outburst of national grief on account of his death became proverbial (Zechariah 12:11; compare Revelation 16:16).