From Matthew Henry’s Commentary on the Whole Bible:
“IV. David’s pious dependence upon the divine providence and grace in this distress: But David encouraged himself in the Lord his God. His men fretted at their loss. The soul of the people was bitter, so the word is. Their own discontent and impatience added wormwood and gall to the affliction and misery, and made their case doubly grievous. But 1. David bore it better, though he had more reason than any of them to lament it; they gave liberty to their passions, but he set his graces on work, and by encouraging himself in God, while they dispirited each other, he kept his spirit calm and sedate. Or, 2. There may be a reference to the threatening words his men gave out against him. They spoke of stoning him; but he, not offering to avenge the affront, nor terrified by their menaces, encouraged himself in the Lord his God, believed, and considered with application to his present case, the power and providence of God, his justice and goodness, the method he commonly takes of bringing low and then raising up, his care of his people that serve him and trust in him, and the particular promises he had made to him of bringing him safely to the throne; with these considerations he supported himself, not doubting but the present trouble would end well. Note, Those that have taken the Lord for their God may take encouragement from their relation to him in the worst of times. It is the duty and interest of all good people, whatever happens, to encourage themselves in God as their Lord and their God, assuring themselves that he can and will bring light out of darkness, peace out of trouble, and good out of evil, to all that love him and are the called according to his purpose, Rom_8:28. It was David’s practice, and he had the comfort of it, What time I am afraid I will trust in thee. When he was at his wits’ end he was not at his faith’s end. “
I felt encouraged by this passage and wanted to share it, along with Mr. Henry’s commentary on it.


