Psalm 6 is one of the 7 Penitential Psalms of the early Church (6,32,38,51,102,130,143). It describes David in a terrible state, in a perfect storm of problems. He is weak, like a withered plant, and sick, with his body wracked in pain (v2), also in a state of emotional distress and mental torment (v3), grief and depression (v6-7), even close to death (v5). Also, he has many enemies coming against him (v8-10). He realises the root cause of all this and the greatest of his problems is that he is not right with God, as he has sinned, and so is under God's discipline. Thus, it begins with David acknowledging his sin and asking God to forgive him: "O Lord, do not rebuke me in Your anger" (v1). When we confess our sin to God, He forgives us and cleanses us from it (1John 1:9), but that is not enough for our full restoration. Our sin causes us to be separated from God's Presence and blessing, and puts us in a negative (unclean) state. When we confess our sin, we are forgiven and cleansed by the Blood of Jesus, which blots out the sin, and brings us into a neutral (common) state. However, there is still a lack of the God's Presence (an emptiness in our soul), which makes us vulnerable to sinning again and becoming unclean (Matt 12:43-45). The only way to be empowered to overcome sin and be restored to a positive (holy) state of blessing is to rededicate ourselves to God and invite His Holy Spirit to fill us. God can't fill what is unclean - 1st we must be cleansed by His Blood and then we can be consecrated (made holy) by the Oil of His Holy Spirit possessing us. This is why he does not stop with his confession in v1, but continues by saying: "Be gracious to me, O Lord, for I am weak" (v2a). He is asking God to fill him with His grace and restore him in every area of his life. Having done this, He now looks to his Lord in confident faith to move quickly to heal him and restore his soul: "but You, O Lord - how long?" (v3). As he returns to the Lord, he asks Him to also return (turn back) to him and restore His Presence in his soul and body and deliver him from his sickness (v4a). His prayers are based on his covenant with God, who is a covenant-keeping God (he uses God's personal covenant name 'Yahweh' many times in Psalm 6), for he appeals to God's unfailing covenant love as the basis of his petition: "Oh, save me because of Your mercies (chesed = steadfast love)" (v4b). He also pleads his case for God to save his life on the basis of His greater glory, reminding God he can glorify Him much more if He keeps him alive, rather than letting him die and go down to Sheol (the underworld): "For in death there is no remembrance of You; in the grave (Sheol) who will give You thanks?" (v5). This is not saying people are unconscious in Sheol-Hades, or that believers will not praise God there. Luke 16:19-31 proves that all men in Hades are conscious, and Psalm 115:17-18 shows that although 'the dead' (unbelievers) do not praise God there, believers continue to praise God after death. Rather it means, he will not be able to glorify God in Sheol in the same way as in this life. v5 can be translated: "For in death no Memorials are made to You." This refers to public worship at the Feasts (Esther 9:28). After death, he says he will not be able to glorify God and give Him thanks, as much as in this life, especially at the Feasts. This shows the special importance of this life, and the opportunity it gives us to glorify God, especially in our public worship.
In v8-10, David is now confident God has heard his prayer and now has the assurance that He will give him the victory over his enemies. He is no longer afraid of them but says to them: "Depart from me, all you workers of iniquity" (v8a). Now God has returned to him and is with him, they must flee from him, for if God is for him, who can be against him (Rom 8:31, Jam 4:7). He declares: "for the Lord has heard the voice of my weeping" (v8b), referring to his tears of contrition and grieving over his loss of God's Presence because of his sin, compounded by the personal rejection and hostility from his enemies (v6-7). Then he reaffirms his faith that: "The Lord has heard my supplication; the Lord receives my prayer" (v9). As with 5:10, 6:10 is an imprecatory verse: "Let all my enemies be ashamed and greatly troubled; let them turn back and be ashamed (disgraced) suddenly." The word 'troubled' is the same word as used in v2 & 3 to describe David's troubles due to his sin. Thus he prays for his enemies that they will fail in their evil endeavours, that their sin will be exposed and that they face the troubling consequences of their sin (as David did), so that they will turn back from their evil course of action, and also turn back to God in repentance (as David did), before it is too late for them. v10 can also be translated as a prophetic declaration, as in the ESV: "All my enemies be ashamed and greatly troubled. They will turn back and be ashamed suddenly."