Psalmists use all sorts of things to be clear to God about how they actually are, what they want, and how the second fits in with his grand plan for the World and His Glory. They put his promises back in front of him, they order him around, they are clear about his role as the redeemer of their lives and souls.
Jesus quoted this one as he died on the cross. Jesus, using God’s words, as God, to Answer God, in the moment of His greatest distress and anguish. We should use them this way too.
In you, O LORD, do I take refuge;
let me never be put to shame;
in your righteousness deliver me!
Incline your ear to me;
rescue me speedily!
Be a rock of refuge for me,
a strong fortress to save me!
For you are my rock and my fortress;
and for your name’s sake you lead me and guide me;
you take me out of the net they have hidden for me,
for you are my refuge.
Into your hand I commit my spirit;
you have redeemed me, O LORD, faithful God.
I hate those who pay regard to worthless idols,
but I trust in the LORD.
I will rejoice and be glad in your steadfast love,
because you have seen my affliction;
you have known the distress of my soul,
and you have not delivered me into the hand of the enemy;
you have set my feet in a broad place.
Be gracious to me, O LORD, for I am in distress;
my eye is wasted from grief;
my soul and my body also.
For my life is spent with sorrow,
and my years with sighing;
my strength fails because of my iniquity,
and my bones waste away.
Because of all my adversaries I have become a reproach,
especially to my neighbors,
and an object of dread to my acquaintances;
those who see me in the street flee from me.
I have been forgotten like one who is dead;
I have become like a broken vessel.
For I hear the whispering of many—
terror on every side!—
as they scheme together against me,
as they plot to take my life.
But I trust in you, O LORD;
I say, “You are my God.”
My times are in your hand;
rescue me from the hand of my enemies and from my persecutors!
Make your face shine on your servant;
save me in your steadfast love!
O LORD, let me not be put to shame,
for I call upon you;
let the wicked be put to shame;
let them go silently to Sheol.
Let the lying lips be mute,
which speak insolently against the righteous
in pride and contempt.
Oh, how abundant is your goodness,
which you have stored up for those who fear you
and worked for those who take refuge in you,
in the sight of the children of mankind!
In the cover of your presence you hide them
from the plots of men;
you store them in your shelter
from the strife of tongues.
Blessed be the LORD,
for he has wondrously shown his steadfast love to me
when I was in a besieged city.
I had said in my alarm,
“I am cut off from your sight.”
But you heard the voice of my pleas for mercy
when I cried to you for help.
Love the LORD, all you his saints!
The LORD preserves the faithful
but abundantly repays the one who acts in pride.
Be strong, and let your heart take courage,
all you who wait for the LORD!
(Psalm 31 ESV)