Praying a "prayer of repentance" whenever we know that we have willfully sinned is a necessity for every Christian. Of course, repentance is required in obeying the Gospel of Jesus Christ. After we are saved though, we still have to deal with our flesh, the world, and attacks by the devil and his demonic minions. The Apostle John wrote this to believers:
If we say that we have no sin, we deceive ourselves, and the truth is not in us. If we confess our sins, He is faithful and just to forgive us our sins and to cleanse us from all unrighteousness. If we say that we have not sinned, we make Him a liar, and His word is not in us (1 John 1:8-10 NKJV).
Then John reminds us that Jesus is our advocate and the propitiation for our sins:
My little children, these things I write to you, so that you may not sin. And if anyone sins, we have an Advocate with the Father, Jesus Christ the righteous. And He Himself is the propitiation for our sins, and not for ours only but also for the whole world (1 John 2:1-2 NKJV).
Living a repentant lifestyle is absolutely necessary to get to heaven as the concept of "once saved always saved" is not true. King David knew this to be true. After he committed adultery with Bathsheba and murdered her husband Uriah, David wrote Psalm 51.
I like praying Psalm 51, just as it is, when I know that I need to make a course correction in my life, praying a prayer of repentance, turning fully back to my Great God and Savior, Jesus Christ.
1. Have mercy upon me, O God,
According to Your loving kindness;
According to the multitude of Your tender mercies,
Blot out my transgressions.
2. Wash me thoroughly from my iniquity,
And cleanse me from my sin.
3. For I acknowledge my transgressions,
And my sin is always before me.
4. Against You, You only, have I sinned,
And done this evil in Your sight—
That You may be found just when You speak,
And blameless when You judge.
5. Behold, I was brought forth in iniquity,
And in sin my mother conceived me.
6. Behold, You desire truth in the inward parts,
And in the hidden part You will make me to know wisdom.
7. Purge me with hyssop, and I shall be clean;
Wash me, and I shall be whiter than snow.
8. Make me hear joy and gladness,
That the bones You have broken may rejoice.
9. Hide Your face from my sins,
And blot out all my iniquities.
10. Create in me a clean heart, O God,
And renew a steadfast spirit within me.
11. Do not cast me away from Your presence,
And do not take Your Holy Spirit from me.
12. Restore to me the joy of Your salvation,
And uphold me by Your generous Spirit.
13. Then I will teach transgressors Your ways,
And sinners shall be converted to You.
14. Deliver me from the guilt of bloodshed, O God,
The God of my salvation,
And my tongue shall sing aloud of Your righteousness.
15. O Lord, open my lips,
And my mouth shall show forth Your praise.
16. For You do not desire sacrifice, or else I would give it;
You do not delight in burnt offering.
17. The sacrifices of God are a broken spirit,
A broken and a contrite heart—
These, O God, You will not despise.
18. Do good in Your good pleasure to Zion;
Build the walls of Jerusalem.
19. Then You shall be pleased with the sacrifices of righteousness,
With burnt offering and whole burnt offering;
Then they shall offer bulls on Your altar.
Psalm 51:1-19 NKJV
In the name of Jesus Christ, we pray!