Josiah's reward for being penitent and remorseful when Judah sinned against the LORD by worshipping other gods was
Answer Details
King Josiah's story is recorded in 2 Kings 22-23 and 2 Chronicles 34. When the Book of the Law was discovered in the Temple during repairs, Josiah heard its contents and tore his robes in distress, recognising how severely Judah had sinned by worshipping other gods. He sent priests to inquire of God through the prophetess Huldah.
God's response through Huldah acknowledged Josiah's penitent and remorseful heart. Because Josiah had humbled himself, wept before the Lord, and torn his robes in grief over Judah's sins, God granted him a specific reward: he would not witness the desolation that God planned to bring upon Judah and Jerusalem (2 Kings 22:19-20). God promised that Josiah would be gathered to his grave in peace before the disaster came.
God did not promise that Judah would be spared from destruction - the judgement was certain and would come after Josiah's time. The reward was personal to Josiah: he would die before seeing his nation's ruin. Rebuilding the Temple was associated with a later period (post-exile under Zerubbabel). The promise concerned Josiah individually, not the preservation of his family from pestilence.