Joash, the son of Ahaziah, was the seventh king of Judah succeeding his grandmother Athaliah after she was put to death. Athaliah had ascended to the throne in a bloody coup. When her son Ahaziah (Joash's father) died, she executed all the members of the royal family - with one exception.
When Athaliah the mother of Ahaziah saw that her son was dead, she proceeded to destroy the whole royal family. But Jehosheba, the daughter of King Jehoram and sister of Ahaziah, took Joash son of Ahaziah and stole him away from among the royal princes, who were about to be murdered. She put him and his nurse in a bedroom to hide him from Athaliah; so he was not killed. He remained hidden with his nurse at the temple of the LORD for six years while Athaliah ruled the land.
(2 Kings 11:1-3)
When Joash was only seven, Jehoida, a priest of Judah, crowned him king and then instructed his soldiers to kill Athaliah died. Mentored by the godly Jehoiada, Joash eliminated many of the evils instituted by his forebears. Most notably, he supervised the reconstruction of Solomon's temple, which was deteriorating with age. So long as Jehoida lived, Joash was at his best, but when the priest died, Joash went astray. He fell away into evil courses, and the land was defiled with idolatry.
He went so far away from God, that he ordered the stoning of Jehoida's son, Zechariah, who had confronted him about his son. It was to cost him his life at the hands of his own servants who sought revenge for Zechariah's death.
Joash ruled for forty years. He is one of the three kings omitted by Matthew in the genealogy of Christ, the other two being Ahaziah and Amaziah. In recognition of his turn to evil, Joash was refused burial in the cemetery of the kings, being laid to rest in a commoner's grave.
He was succeeded on the throne by his son Amaziah.