When King Josiah heard the book of the law read, he rent his garments. Josiah knew that God's people were accountable to obey God's word whether they cared enough to know it or not. He also knew that God's people were not obeying God's word and thereby were under condemnation (2 Kgs 22:13). Thus, in deep sorrow for sin and in dread of punishment, Josiah rent his garments.
The prophetess, Huldah, prophesied regarding Josiah and his rending of his garments: "Thus says the Lord, the God of Israel: As for the threats you have heard, because you were heartsick and have humbled yourself before the Lord when you heard My threats that this place and its inhabitants would become a desolation and a curse; because you tore your garments and wept before Me; I in turn have listened, says the Lord" (2 Kgs 22:18-19). Josiah was forgiven his disobedience of God's word, and he was also spared seeing the punishing of God's people (2 Kgs 22:20).
We too have disobeyed God's word, and therefore we have "a fearful expectation of judgment and a flaming fire to consume the adversaries of God" (Heb 10:27). "Yet even now, says the Lord, return to Me with your whole heart, with fasting, and weeping, and mourning; rend your hearts, not your garments, and return to the Lord, your God. For gracious and merciful is He, slow to anger, rich in kindness, and relenting in punishment" (Jl 2:12-13). "Rend your hearts!" (Jl 2:13)