2 Chronicles 24:18

And they left the house of the LORD God of their fathers, and served groves and idols: and wrath came upon Judah and Jerusalem for this their trespass.

This verse belongs to the record of the kings in Judah covering the forty-year reign of Joash.
Joash was strong to do right only while guided by the strong, good priest Jehoiada, and as soon as Jehoiada died his own heart yielded to evil.
All the human credit for the good done during his reign belongs not to Joash but to Jehoiada, for evil teachings from Joash's ancestors had taken root in his own heart, so that when the restraint of Jehoiada was removed the king turned aside into the way of the house of Ahab, leaving the house of the Lord to serve groves and idols.
His promising early start as king did not ensure faithfulness, for unlike Josiah he failed to stand for God and lead the people toward reform after his instructor was gone.

The verse records that Judah and Jerusalem left the house of the Lord God of their fathers and served groves and idols, and that wrath came upon them for this trespass.
Departing from God brought strife, captivity, and great loss upon Judah and Jerusalem.
The verse illustrates that sin brings sure judgment.
The surrounding account of Judah's kings also shows God's mercy when people repent and return to him.
Judah's later course continued downward as transgressions accumulated and messages were rejected, ending in Jerusalem's destruction and the people's exile to Babylon.