- Confession of sin: vv. 6-7, 11, 18
- Asking for guidance and protection: vv. 1, 4-5, 8-9, 14-17, 19-22
- Proclaiming great things about God: These are scattered in throughout the psalm.
- Prayer for others: v. 22 and included in other parts when he mentions "those who" and similar phrases
This is a good pattern for your own prayer life. There's an acrostic prayer guide that has been around for - well, decades - called the ACTS of prayer.
A - Adoration (Tell God how wonderful He is)
C - Confession (Ask forgiveness for your sins - be specific)
T - Thanksgiving (Thanking God for His blessings, answers to prayer, etc.)
S - Supplication (Pray for others)
Davids prayer (psalm) doesn't follow the ACTS outline in a strict kind of way. His prayer is more organic. He flows back and forth from one to the other as he pours his heart out to God.
You don't have to follow a strict outline to pray - like the ACTS of Prayer, but it is good to have all of those items in your prayers. As you are praying you may be thanking God for something and that may remind you of a sin in some way. Don't say, "oops, sorry, I"m past the confession time of my prayer." Let God's Spirit guide you as you pray. Be sensitive to His leading. Hear His voice. Then follow where He leads - not just in how you prayer, but how you live your life.