This psalm is broken into four stanzas.
The first stanza (vv. 1-3) amounts to a plea for mercy and grace. David asks that God not rebuke him (David) while He (God) is angry, but instead that He (God) would heal him (David). We have all had the experience of knowing that someone was angry with us and had every right to be angry. This seems to be where things stand between David and God. David does not, in this stanza, contest whether or not God ought to be angry, only pleads for grace.
The second stanza (vv. 4-5) asks God to rescue David, giving the reason that there is neither remembrance nor mention of God in Sheol, which is roughly equivalent to the Greek Hades. This reveals a bit about what David thinks happens after death. He seems to believe that there is some place to which souls go. He also seems to think that those souls do not remember what has happened in life.
The third stanza (vv. 6-7) is David’s description of his state. He has been grieving; weeping; agonizing over his adversaries. And this makes me wonder when in his life this psalm was written. There were many times in David’s life that he faced enemies and a fair few wherein the adversary was someone dear to him or related to someone dear to him.
In the final stanza (vv. 8-10), David issues one command and makes two statements. The command is that those who do iniquity would depart from him. Another way to render the phrase might be that David wants the troublemakers to get lost. And the reason for this is that God has heard his prayer and that David’s enemies will be ashamed and greatly dismayed.
The encouragement for me is this: even when God has every reason to be angry with me, I can call out to Him for mercy and grace and help in my need and He will hear me and be merciful and gracious. This is not a license to do things that will anger God. That would be presumptuous. Rather, this is an invitation to seek God even when I fear He might not want to hear from me. When I have done something foolish and want His mercy and grace, but fear that I will be met with His righteous wrath instead, this psalm is an encouragement that God will hear and will be gracious.
Thank You, Father, for this encouragement; for this invitation to come to You and be heard, even when You have every right to be angry with me. Even then, You will love me and want to restore me. Thank You for loving in a way that I cannot fathom and may not ever be able to emulate this side of eternity.