Historical commentary by Matthew Henry. The wording and interpretations below belong to the original source.
Devout Affections.
The title tells us when the psalm was penned, when David was in the wilderness of Judah; that is, in the forest of Hareth ( 1 Sam. xxii. 5 ) or in the wilderness of Ziph, 1 Sam. xxiii. 15 . 1. Even in Canaan, though a fruitful land and the people numerous, yet there were wildernesses, places less fruitful and less inhabited than other places. It will be so in the world, in the church, but not in heaven; there it is all city, all paradise, and no desert ground; the wilderness there shall blossom as the rose. 2. The best and dearest of God's saints and servants may sometimes have their lot cast in a wilderness, which speaks them lonely and solitary, desolate and afflicted, wanting, wandering, and unsettled, and quite at a loss what to do with themselves. 3. All the straits and difficulties of a wilderness must not put us out of tune for sacred songs; but even then it is our duty and interest to keep up a cheerful communion with God. There are psalms proper for a wilderness, and we have reason to thank God that it is the wilderness of Judah we are in, not the wilderness of Sin.
David, in these verses, stirs up himself to take hold on God,
I. By a lively active faith: O God! thou art my God. Note, In all our addresses to God we must eye him as God, and our God, and this will be our comfort in a wilderness-state. We must acknowledge that God is, that we speak to one that really exists and is present with us, when we say, O God! which is a serious word; pity it should ever be used as a by-word. And we must own his authority over us and propriety in us, and our relation to him: " Thou art my God, mine by creation and therefore my rightful owner and ruler, mine by covenant and my own consent." We must speak it with the greatest pleasure to ourselves, and thankfulness to God, as those that are resolved to abide by it: O God! thou art my God.
II. By pious and devout affections, pursuant to the choice he had made of God and the covenant he had made with him.
1. He resolves to seek God, and his favour and grace: Thou art my God, and therefore I will seek thee; for should not a people seek unto their God? Isa. viii. 19 . We must seek him; we must covet his favour as our chief good and consult his glory as our highest end; we must seek acquaintance with him by his word and seek mercy from him by prayer. We must seek him, (1.) Early, with the utmost care, as those that are afraid of missing him; we must begin our days with him, begin every day with him: Early will I seek thee. (2.) Earnestly: " My soul thirsteth for thee and my flesh longeth for thee (that is, my whole man is affected with this pursuit) here in a dry and thirsty land. " Observe, [1.] His complaint in the want of God's favourable presence. He was in a dry and thirsty land; so he reckoned it, not so much because it was a wilderness as because it was at a distance from the ark, from the word and sacraments. This world is a weary land (so the word is); it is so to the worldly that have their portion in it—it will yield them no true satisfaction; it is so to the godly that have their passage through it—it is a valley of Baca; they can promise themselves little from it. [2.] His importunity for that presence of God: My soul thirsteth, longeth, for thee. His want quickened his desires, which were very intense; he thirsted as the hunted hart for the water-brooks; he would take up with nothing short of it. His desires were almost impatient; he longed, he languished, till he should be restored to the liberty of God's ordinances. Note, Gracious souls look down upon the world with a holy disdain and look up to God with a holy desire.