2 Samuel 17:14

17:14 Then Absalom and all the men of Israel said, “The advice of Hushai the Arkite sounds better than the advice of Ahithophel.” Now the Lord had decided to frustrate the sound advice of Ahithophel, so that the Lord could bring disaster on Absalom.

2 Samuel 17:23

17:23 When Ahithophel realized that his advice had not been followed, he saddled his donkey and returned to his house in his hometown. After setting his household in order, he hanged himself. So he died and was buried in the grave of his father.