This Psalm is thought to be the like a second verse from Psalm 3, a song about Absalom's rebellion, an evening hymn sung by King David and his men. Can't you just see David and his soldiers sitting around a campfire after a hard day at battle singing together. It makes me think of Gene Autry or Roy Rogers and their cowboy friends singing together around their campfire at night (that's the country music I grew up with). It starts out a little desperate, a little sad, then gets sadder.
"Answer me when I call, O God of my righteousness!
Thou hast relieved me in my distress;
Be gracious to me and hear my prayer."
As in most country music songs, David has lost his house, lost his girlfriends (concubines), but I don't know about his dogs. Yep, it's a sad song alright.
Then they go on to sing about Absalom. Adam Clarke doesn't pussy-foot around when he describes David's long-haired lover boy rebellious offspring: "The poor, empty, shallow-brained, pretty-faced Absalom, whose prospects are all vain, and whose promises are all empty!" That's how a man from the 1700's talks about the no-good, two-timing, thieving son of a king who's trying to yank the kingdom away for himself. This is what David sang...
"O sons of men, how long will my honor (glory) become a reproach?
How long will you love what is worthless and aim at deception?"
Now in contrast we see how God loves His offspring, His chosen ones, "the pious, benevolent man." (Adam Clarke)
"But know that the Lord has set apart the godly man for Himself
"The Lord hears when I call to Him."
Now that's a memory verse right there! I know I've pulled it out from the leather bindings to look it up from time to time. Set apart, means cherished, loved, or as it says in my Bible's itsy bitsy side notes, "dealt wonderfully with." Set apart in the New Testament is the meaning of the word "sanctified," set apart for God's use.
"Tremble, and do not sin;"
The King James says,
"Stand in awe and sin not."
In the New Testament Paul translates this verse he quotes in Ephesians 4:26 from Psalm 4:4 as "Be angry, and yet do not sin." Hmm. Is David saying that he has to lay down his anger about his son as he stands in awe, trembling before God? Good advice.
"Meditate in your heart upon your bed, and be still."
This could also be translated, "and be dumb." This doesn't mean dumb as in stupid, but don't be stupid, be dumb, shut your mouth. Or in other words, "hold your peace; lest you be found fighting against God." (Adam Clarke)
"Offer the sacrifices of righteousness,
And trust in the Lord."
"Many are saying, 'Who will show us any good?'
Lift up Thy countenance upon us, O Lord!
Thou hast put gladness in my heart,
More than when their grain and new wine abound."
More strictly translated, "'Who will show us good?' "Lift up the light of thy countenance. This alone, the light of thy countenance --Thy peace and approbation (approval, I had to look it up)--constitute the supreme good." (Adam Clarke) Isn't the world asking us that "Who will show us good?" It is in short supply except in the light of the face of God. If you take God's countenance out of this world, it is indeed utter darkness.
"Thou hast put gladness in my heart." "Thou hast given my soul what it wanted and wished for. I find now a happiness which earthly things could not produce. I have peace of conscience, and joy in the Holy Ghost; such inward happiness as they cannot boast who have got the increase of corn and wine." (Adam Clarke) David is in temporary exile. His palace, his throne have been left behind. But he has brought the Ark of the Covenant with him. It symbolizes the presence of God. Gladness of heart is not something to be taken lightly. It is what makes the heart light instead of heavy. So finally...
"In peace will both lie down and sleep,
For Thou alone, O Lord, dost make me to dwell in safety."
So this Psalm is the evening hymn, song before bed that the king sings to his people, like cowboys singing to their herd to keep them calm, telling them that like himself, they can lay down in peace while in exile because God makes them to dwell in safety. The campfire has burned down to the coals, the stars have come out, and quiet descends on the camp. Only the crickets are left singing.