What does Psalm 39:2 mean?
David had determined to refrain from speaking, presumably because he feared he might say something that would defame God's character. No details are given about the situation which inspired this psalm. It's possible David was being confronted by wicked people about some sin or failure on his part (Psalm 39:8–11). Perhaps he was worried that his words would be overly harsh, or that he would return slander with slander. It's also possible David didn't want to speak wrongly about God, or regarding God, so instead he made the difficult choice to keep silent (Psalm 39:1).Unfortunately, this experience was frustrating. Keeping silent in the presence of these wicked ones began to wear on David. The Hebrew phrasing rendered "to no avail" can also be translated, "without success." Some translations imply David said literally nothing: that he declined to engage these evil persons, at all (Matthew 6:7–8). Whatever David hoped to accomplish in his own heart by saying nothing, he instead became more aggravated. No insight is given as to whether his angst was driven by seeing the wicked experiencing success, their attacks on him, or simply he conviction he felt for his own sin.
A Christian may be deeply troubled by what he considers unfair action on God's part, but he should not remain silent. This does not mean confronting those who are evil, or accusing God, but rather it means taking those conflicts to God in prayer. Keeping such things unspoken simply increases one's frustration. When Asaph was troubled by the prosperity of the wicked, he did not allow apparent injustice to ruin his fellowship with God. Instead, he laid the matter before the Lord. He writes in Psalm 73:16–17, "But when I thought how to understand this, it seemed to me a wearisome task, until I went into the sanctuary of God, then I discerned [the wicked people's fate]."
David makes a similar choice in this psalm. When his frustration reaches a breaking point, he speaks—but to the Lord, rather than to those he sees as evil (Psalm 39:3–4).