Leviticus 26:40 If they shall confess their iniquity, and the iniquity of their fathers, with their trespass which they trespassed against me, and that also they have walked contrary unto me.
The consequences of walking contrary to the Lord are indeed terrible, and sin makes life miserable. However, He gives us opportunity to return to Him by means of confession of sin. This is what happened to the people of Israel: after going into exile as a consequence of their sin and rebellion, God gave them a way to mitigate the suffering of sin and death: confess. Then the Lord will remember the covenant and the land.
Confession is the response to the condition we find ourselves in on account of our own sin and guilt. Confession admits that I was wrong and God was right. Confession also embraces a second part: receiving absolution, and the confession that God forgives because of Christ. It is repentance and faith in the Gospel.
It doesn’t have to take centuries of unbelief, and then losing everything in exile. Confession can be made any time and all the time as a way of life, And the Lord is always there to remember His Covenant in the Blood of Christ. The Lord in continually restoring us to Himself. “If we confess our sins God is faithful and just to forgive our sins and cleanse us from all unrighteousness.”