Suffering affliction at the hands of the wicked. As in Psalm 12, there is the observation that the godly are struggling, as the wicked prevail. The specific context may be Saul's persecution of David.
v1-2: Men forgot and despised David; he even asked God "Will you forget me forever?" David had suffered for many days, daily he had sorrow in his heart. Yet there was silence from God. Yet faith will trust, even in days of silence.
David spoke of wrestling with his thoughts, and of sorrow in his heart; here is a period of depression and discouragement. As elsewhere, this speaks into real human experience. The psalms provide numeorus examples of expressions of deep pain; if we know God as our Father, He encourages us to do just this.
v3-4: Prayer, demonstrating dependence upon God. The prayer, that God would act and turn things around.
v5-6: As in Psalm 11, we must look up, trusting in God. We recognise that God is unchanging. We can rejoice even in difficult circumstances, because of who God is.
The closing testimony, that God is generous in His dealings with His people.