Josiah makes a last-ditch effort to save the Israelites and fails.
Josiah is 8 when he ascends the throne of Israel. When he's 18, he sends one of his scribes to the temple to see how the treasury is doing so he can have it repaired. When the scribe talks to Hilkiah the priest, he reveals a book he found, which is Deuteronomy, Moses dying rant to the Israelites. As his scribe reads it to him, Josiah gets so upset he rends his clothes. As anyone would, if forced to sit and listen to the entire book of Deuteronomy in one go. He also orders him to find out what exactly the book means for the future of Israel.
The scribe and the priest go to Huldah the prophetess, who lives in a college. Huh. I didn't know they had colleges then. She tells them god is angry and planning to destroy Israel, because they've been worshipping other gods. Well, they've been doing that since the beginning of 1 King's, so I don't know why it's happening now, except for narrative convenience. The only comfort she can offer Josiah is that god will let him die peacefully and he won't see the fall.