David left Gath and was so alone that he despairs. And now David feels abandoned as moves to a new location that is very foreign to him. David wrote Psalm 13—how to overcome the feelings of despair, abandonment and loneliness when we are in a very dark situation that seems hopeless.
The psalmist complains that God had long withdrawn. He earnestly prays for comfort. He assures himself of an answer of peace. – God sometimes hides his face, and leaves his own children in the dark concerning their interest in him: and this they lay to heart more than any outward trouble whatever. But anxious cares are heavy burdens with which believers often load themselves more than they need. The bread of sorrows is sometimes the saint’s daily bread; our Master himself was a man of sorrows. It is a common temptation, when trouble lasts long, to think that it will last always. Those who have long been without joy, begin to be without hope. We should never allow ourselves to make any complaints but what drive us to our knees. Nothing is more killing to a soul than the want of God’s favour; nothing more reviving than the return of it. The sudden, delightful changes in the book of Psalms, are often very remarkable. We pass from depth of despondency to the height of religious confidence and joy. – Matthew Henry
But now prayer lifteth up her voice, like the watchman who proclaims the daybreak. Now will the tide turn, and the weeper shall dry his eyes. The mercy-seat is the life of hope and the death of despair. The gloomy thought of God’s having forsaken him is still upon the Psalmist’s soul, and he therefore cries, “Consider and hear me.” He remembers at once the root of his woe, and cries aloud that it may be removed. The final absence of God is Tophet’s fire, and his temporary absence brings his people into the very suburbs of hell. God is here entreated to see and hear, that so he may be doubly moved to pity. What should we do if we had no God to turn to in the hour of wretchedness? – Treasury of David
David found hope in his dark hour because troubles and temptations always pushed him toward the Lord. Even when he felt all alone, he discovered that his God was still there sustaining him through the storms.
How long, LORD? Will you forget me forever? How long will you hide your face from me? How long must I wrestle with my thoughts and day after day have sorrow in my heart? How long will my enemy triumph over me? Look on me and answer, LORD my God. Give light to my eyes, or I will sleep in death, and my enemy will say, “I have overcome him,” and my foes will rejoice when I fall. But I trust in your unfailing love; my heart rejoices in your salvation. I will sing the LORD’s praise, for he has been good to me. – Psalm 13