Moses
Psalm 40:2BSB·traditional attribution

He lifted me up from the pit of despair, out of the miry clay; He set my feet upon a rock, and made my footsteps firm.

John Calvin Reformed @genevareformer

PSALM 40 David, being delivered from some great danger, and it may be, not from one only, but from many, extols very highly the grace of God, and by means of this, his soul is filled with admiration of the providence of God, which extends itself to the whole human race.

Commenting on Psalm 40:1-17

C.H. Spurgeon Reformed Baptist @princeofpreachers

He brought me up also out of an horrible pit. When our Lord bore in his own person the terrible curse which was due to sin, he was so cast down as to be like a prisoner in a deep, dark, fearful dungeon, amid whose horrible glooms the captive heard a noise as of rushing torrents, while overhead resounded the tramp of furious foes.

Matthew Henry Presbyterian @wholebiblehenry

In these verses we have, I. The great distress and trouble that the psalmist had been in. He had been plunged into a horrible pit and into miry clay (Psa 40:2), out of which he could not work himself, and in which he found himself sinking yet further.

Commenting on Psalm 40:1-5