The psalm opens with a confession of refuge: in you, O Lord, I have taken refuge; let me never be put to shame. He asks God, in his righteousness, to deliver and rescue him, to incline his ear and save him. He asks that God be a rock of refuge to which he can continually come, for God is his rock and his fortress.
Verses 4 to 8 ask for rescue from the hand of the wicked. He recalls that God has been his hope and his trust from his youth. From the womb he has leaned on him, and from his mother's womb God has been his strength. To many he has been a portent, but God is his strong refuge, and his mouth is filled with praise all day.
Verses 9 to 13 hold the center of the lament: do not cast me off in the time of old age; do not forsake me when my strength is spent. His enemies speak against him and take counsel together, saying that God has forsaken him and that they can pursue him because no one will deliver him. He asks God not to be far from him and to hurry to help him, and that his accusers be put to shame.
In verses 14 to 24, the psalmist decides to hope continually and to praise more and more. He will tell of God's righteousness and salvation all day long, though he does not know their number. Since his youth God has taught him, and even to old age and gray hairs he asks not to be forsaken until he proclaims God's might to the next generation. God's righteousness reaches to the high heavens, and the one who has done great things has no equal. Although God has made him see many troubles, he will revive him again and bring him up from the depths of the earth. He will increase his greatness and comfort him again. So the psalmist will praise God with harp and lyre, sing to the Holy One of Israel, and his lips will shout for joy, for those who sought his hurt have been put to shame.