PSALM 32:3-7
"3 When I kept silent about my sin, my body wasted away through my groaning all day long. 4 For day and night Your hand was heavy upon me; my vitality was drained away as with the fever heat of summer. [Selah] 5 I acknowledged my sin to You, and my iniquity I did not hide; I said, “I will confess my transgressions to the Lord”; and You forgave the guilt of my sin. [Selah]
6 Therefore, let everyone who is godly pray to You in a time when You may be found; surely in a flood of great waters they will not reach him.
7 You are my hiding place; You preserve me from trouble; You surround me with songs of deliverance. [Selah]."
This shows how important it is to be close to God. Keep the accounts short. Keep the lines of communication open. Do your confessing business at a time when the confessing needs to be done, not when the floods come in. There may be a time when it is too late to confess, or at least not profitable - - when you get into the stage of being in the "floods of great waters".
If you’re standing in the swamp when the flood comes, who’s fault is that?