This is a song of ascents, meaning that it would have been sung on a pilgrimage to the temple in Jerusalem.
They would have been going with a view to offer sacrifices at the temple according to the law of Moses, and it seems that the Psalm is a lament from someone who knows they have sinned and are in urgent need of forgiveness.
Their situation seems dire. They are at rock bottom, yet they appeal to God’s merciful nature as it has manifested itself to them so many times. This is the Pslamist’s only hope to get into God’s presence.
“Blessed are those who mourn, for they will be comforted” says Jesus, and I think this is what he means: becoming aware of sin and being convicted by it. The comfort comes from knowing that there is forgiveness in the Lord.
The Psalmist is desperate to hear God’s word, which he is on his way to hear: given his current state, it’s likely that he’s keen to hear that he’s been forgiven when his sacrifice has been accepted at the temple.
The waiting becomes a certainty in the last as he encourages everyone to trust in the Lord’s certain redemption of his people.
I think this Psalm is a great pattern for a confessional prayer: we start with a conviction of sin, a confession, but then we can turn to God’s mercy, and to that only, to ask for forgiveness. The Psalmist knew he would hear God’s mercy after his sacrifice: we know that through Jesus’ sacrifice we can receive it by faith.
A Song of Ascents.
Out of the depths I cry to you, O Lord!
O Lord, hear my voice!
Let your ears be attentive
to the voice of my pleas for mercy!
If you, O Lord, should mark iniquities,
O Lord, who could stand?
But with you there is forgiveness,
that you may be feared.
I wait for the Lord, my soul waits,
and in his word I hope;
my soul waits for the Lord
more than watchmen for the morning,
more than watchmen for the morning.
O Israel, hope in the Lord!
For with the Lord there is steadfast love,
and with him is plentiful redemption.
And he will redeem Israel
from all his iniquities.