David writes his prayer asking God to hear him in his poor and needy state, and to preserve his life. His reasons are varied: He is holy, he cries to God all day long, David lifts up his soul to God, but mostly because God is merciful. David affirms his trust in God’s fairhfulness to hear his prayer. He goes on to praise God further:
8 Among the gods there is none like You, O Lord;
Nor are there any works like Your works.
9 All nations whom You have made
Shall come and worship before You, O Lord,
And shall glorify Your name.
10 For You are great, and do wondrous things;
You alone are God.
David asks God to teach him His way so he can walk in His truth. He praises God highly for His goodness and mercy, delivering David from the depths of hell. He then lets God know that there are evil men working against him to harm him. He follows that by praising God once again for his compassion, grace, mercy, and truth. He finally petitions God for mercy, strength, and salvation.
17 Show me a sign for good,
That those who hate me may see it and be ashamed,
Because You, Lord, have helped me and comforted me.
David approaches God in his typical way: plenty of praise and a bit of petition. Although God is not a jealous, insecure, narcissistic individual, He is GOD! He is worthy of praise, not just desirous of it. Therefore, the key to favor includes the element of praise. Praise is the part of prayer that opens the door to have audience with God. He deserves praise, more than anyone, so give Him praise. Then, offering your petition is proper and welcomed by our powerful and merciful God!