Exodus 34:7pesah
and is kind to thousands of people. The Lord forgives people for evil, for sin, and for turning against him, but he does not forget to punish guilty people. He will punish not only the guilty people, but also their children, their grandchildren, their great-grandchildren, and their great-great-grandchildren."
God forgives turning against him, yet still punishes the guilty.
1 Samuel 7:3
Samuel spoke to the whole group of Israel, saying, "If you're turning back to the Lord with all your hearts, you must remove your foreign gods and your idols of Ashtoreth. You must give yourselves fully to the Lord and serve only him. Then he will save you from the Philistines."
Turning back to the Lord means removing idols and serving him only.