Psalm 119:166. Lord, I have hoped for thy salvation, and done thy commandments.
Here we have salvation by grace, and the fruits thereof. All David's hope was fixed upon God, he looked to him alone for salvation; and then he endeavoured most earnestly to fulfil the commands of his law. Those who place least reliance upon good works are very frequently those who have the most of them; that same divine teaching which delivers us from confidence in our own doings leads us to abound in every good work to the glory of God. In times of trouble there are two things to be done, the first is to hope in God, and the second is to do that which is right. The first without the second would be mere presumption: the second without the first mere formalism. It is well if in looking back we can claim to have acted in the way which is commanded of the Lord. If we have acted rightly towards God we are sure that he will act kindly with us.
Charles Spurgeon, writing in The Treasury of David.