Judges 10:16
And they put away the strange gods from among them, and served the LORD: and his soul was grieved for the misery of Israel. And they put away the strange gods from among them, and served the LORD: and his soul was grieved for the misery of Israel.
This verse comes when Israel was crying out to the Lord after forsaking Him and serving other gods while suffering under its enemies. That turning followed a period of serving Baalim and enduring oppression, including Ammonite oppression. Before putting away their idols, the people named their specific sins of forsaking God and serving Baalim, submitted to whatever He saw fit to do with them, and still pleaded for Him to rescue them that very day. Their putting away of the strange gods and idols from among them and serving the Lord alone was sincere repentance that acted in harmony with those words of confession. It was not words only, but getting rid of the idols and returning to single service to the Lord.
The misery over which God was grieved was the suffering that followed separation from Him. That included subjugation, enemy oppression, cruelty, and death as the calamities resulting from being cut off from God. His soul being grieved means His great heart of love felt pain, sympathy, and compassion over Israel's misery and suffering. Sin and what it brings upon the sinner grieve His heart. Though Israel had sinned and deserved judgment, God was moved with compassion by that misery. When the people humbled themselves, repented, and removed the sins that had shut out His presence, He heard their prayers and immediately began to deliver them and work for them.