David, the author of this psalm is addressing the people of God. He tells them to confess to God if they have sinned like he did. They are not to keep quiet as he had done and suffered for it. He held his sins in and was distressed until he prayed to God.
Apostle John wrote, “My dear children, I write this to you so that you will not sin. But if anybody does sin, we have one who speaks to the Father in our defense–Jesus Christ, the Righteous One. He is the atoning sacrifice for our sins, and not only for ours but also for the sins of the whole world.” (1 John 2:1-2) And Isaiah the prophet wrote, “Seek the LORD while He may be found; call to Him while He is near. Let the wicked one abandon his way and the sinful one his thoughts; let him return to the LORD, so He may have compassion on him, and to our God, for He will freely forgive.” (Isaiah 55:6-7)
Is there a time when my prayers will not be heard, that is they will not be acted upon by God? What are the mighty waters that rise? David poetically says, “Do not bring unconfessed sin to the grave.” While I am physically alive I will find forgiveness for any sin I have committed if I am sincere and have faith in the name of Jesus, the Messiah. However, when my physical body dies it will be to late to confess sin and ask for forgiveness. Now is the time to fall under the mercy and grace of God before I sink into the mighty waters of the grave.