Only a confession to God. Jehovah answered David’s prayers and strengthened him to go ahead with his life and accomplish something worthwhile.
وَلَمْ يَنَلِ ٱلرَّاحَةَ وَٱلْغُفْرَانَ إِلَّا بَعْدَمَا ٱعْتَرَفَ بِمَعَاصِيهِ لِلهِ .‏