What does Psalm 17:2 mean?
David's desire, expressed in his prayer, is for affirmation and victory. He pleads with God to take notice of justice: to work out David's need into something righteous and just. The ultimate source of this goodness is God alone: from His "presence" is where rescue can be expected.Throughout David's trials in the wilderness, when Saul pursued him, David did not blame God. Instead, he trusted in the Lord and regarded Him as a refuge in time of trouble (Psalm 16:1). Because he honored God, David fully trusted the Lord to be close and active (Psalm 16:8). Therefore, David can be bold in asking the Lord for justice.
Job was another Old Testament man of faith. The Lord allowed the Devil to launch numerous trials, including the severe trials of losing his sons and daughters and his personal health. But the Lord knew Job was righteous, and Job was determined to submit to the testing. Like David, Job knew his hardship was not the result of personal sin. In Job 23:10–11 he states: "But he knows the way that I take; when he has tried me, I shall come out as gold. My foot has held fast to his steps; I have kept his way and have not turned aside."