Psalm 3 showed the journey he went on, in his heart and mind, before God. Psalm 4 is probably a continuation while in the same situation, and he is addressing several different people in this song.
He speaks to God first v1 - answer me - crying out, with confidence, for God to hear him.
He speaks to those who have turned against him v2,3 - 'why believe lies?' he challenges them. Lies and deceptions (wherever they come from) have power only in as much as we believe them. 'Know this', says David, 'God will stand with his own people and will not abandon them.'
He speaks to his friends who are angry at injustice. v4,5. And while that anger may be right, it is hard often for us as people to be angry in the right way, at the right time, to the right measure, with the right motives... and so on. David's counsel here is wise: step back, sleep on it, don't react quickly. Spend time with God - go offer sacrifices... sit at the foot of the Cross again, with Christ, examining your own heart and mind, and then act accordingly.
He speaks to his friends who are despondent and sad. v6,7,8... 'who will show us any good?' Remember the joy we have in God - remember all we are promised in Christ, all he has done for us, and remember how this is a greater joy than all the money in the world, all the material gain you could dream of - 'grain and new wine'.
In our stress we cry out to God, resist the lies that would come and undermine, come back to the cross, trusting Christ in the middle of all our anger and disillusionment at events, and going purposefully to Jesus and all he promises for our source of joy, happiness and meaning.
Easier to say than to do. But we take the first step, as we fall to our knees and cry out - 'answer me when I call to you, O God who declares me innocent.'
Here's the psalm:
For the choir director: A psalm of David, to be accompanied by stringed instruments.
1 Answer me when I call to you,
O God who declares me innocent.
Free me from my troubles.
Have mercy on me and hear my prayer.
2 How long will you people ruin my reputation?
How long will you make groundless accusations?
How long will you continue your lies? Interlude
3 You can be sure of this:
The Lord set apart the godly for himself.
The Lord will answer when I call to him.
4 Don’t sin by letting anger control you.
Think about it overnight and remain silent. Interlude
5 Offer sacrifices in the right spirit,
and trust the Lord.
6 Many people say, “Who will show us better times?”
Let your face smile on us, Lord.
7 You have given me greater joy
than those who have abundant harvests of grain and new wine.
8 In peace I will lie down and sleep,
for you alone, O Lord, will keep me safe.