David was faithful to Yahweh (Ps 31:6-31:8)

“You hate those who pay regard to worthless idols.

But I trust in Yahweh.

I will exalt in your steadfast love.

I will be glad in your steadfast love.

You have seen my affliction.

You have taken heed of my adversities.

You have not delivered me

Into the hand of the enemy.

You have set my feet in a broad place.”

Yahweh hated those who put their trust in vain idols. David trusted in Yahweh. He exalted and was glad in Yahweh’s steadfast love, an often repeated theme. Yahweh had seen the affliction and adversities of David. He had delivered him from his enemies and put his feet on good ground.