This is my comfort in my affliction, That Your word has revived me.
NASB95
This is my comfort in my affliction, that your promise gives me life.
ESV
This is my comfort in my affliction: for thy word hath quickened me.
KJV

David was encouraged to plead the word of promise in prayer, from the recollection of its comfort in his affliction. For the man of God is not exempted from affliction, but he is comforted in it with God's comforts, flowing from the fountain-head. And truly no comforts are like God's comforts, and there are none beside His. They are indeed strong consolations, both in their foundation and their influence; supporting—not only in the prospect, but under the actual pressure of trouble, and fully proportioned to the need of the most sinking calamity. Never therefore are we left unsupported in such a time, or called to drink a cup of unmingled tribulation. In the moments of our bitterest sorrow, how are we compelled to stand amazed at the tenderness, which is daily and hourly exercised towards us! We have always some word exactly suited to our affliction, and which we could not have understood without it; and "a word" thus "spoken in due season, how good is it!" One word of God, sealed to the heart, infuses more sensible relief, than ten thousand words of man. When therefore the word assures of the presence of God in affliction; of His continued pity and sympathy in His most severe dispensations; and of their certain issue to our everlasting good; must not we say of it, This is our comfort in our affliction? How does the Savior's love stream forth from this channel on every side; imparting life, refreshment, strength to those, who but for this comfort would have "fainted," and "perished in their affliction!" This indeed was the end, for which the Scriptures were written; and such power of consolation have they sometimes administered to the afflicted saint, that tribulation has almost ceased to be a trial, and the retrospect has been the source of thankful recollection.

But first the word becomes life—then comfort. And those only, who have felt the quickening power of the word, can realize its consolations. Be thankful, then, Reader, if, when dead in sins, it "quickened you;" and, when sunk in trouble, once and again it has revived you. Yet do not think, that it is any innate power of its own, that works so graciously for you. No. The exhibition of the Savior is the spring of life and consolation. It is because it "testifies of Him," "the consolation of Israel" "afflicted in all our afflictions"—and never failing to uphold with "grace sufficient for us." It is not, however, the word without the Spirit, nor the Spirit generally without the word; but the Spirit by the word—first putting life into the word, and then by the word quickening the soul. The word then is only the instrument. The Spirit is the Almighty agent. Thus the work is the Lord's; and nothing is left for us, but self-renunciation and praise.

He means—Your word is my comfort, or the fact that your word has brought quickening to me is my comfort Or he means that the hope which God had given him was his comfort, for God had quickened him thereby. Whatever may be the exact sense, it is clear that the Psalmist had affliction—affliction peculiar to himself, which he calls "my affliction"; that he had comfort in it—comfort specially his own, for he styles it "my comfort"; and that he knew what the comfort was, and where it came from, for he exclaims—"This is my comfort." The worldling clutches his money-bag, and says, "This is my comfort"; the spendthrift points to his gaiety, and shouts," This is my comfort"; the drunkard lifts his glass, and sings, "This is my comfort"; but the man whose hope comes from God feels the life-giving power of the word of the Lord, and he testifies, "This is my comfort." Paul said, "I know whom I have believed."

Comfort is desirable at all times; but comfort in affliction is like a lamp in a dark place. Some are unable to find comfort in tribulation; but it is not so with believers, for their Savior has said to them, "I will not leave you comfortless." Some have comfort and no affliction, others have affliction and no comfort; but the saints have comfort in their affliction.

The word frequently comforts us by increasing the force of our inner life: "This is my comfort; your word has quickened me." To quicken the heart is to cheer the whole man. Often the near way to consolation is by sanctification and invigoration. If we cannot clear away the fog, it may be better to rise to a higher level, and so to get above it Troubles which weigh us down while we are half dead become mere trifles when we are full of life. Thus have we often been raised in spirit by quickening grace; and the same thing will happen again, for the Comforter is still with us, the Consolation of Israel ever lives, and the very God of peace is evermore our Father. On looking back upon our past life there is one ground of comfort as to our state—the word of God has made us alive, and kept us so. We were dead, but we are dead no longer. From this we gladly infer that if the Lord had meant to destroy he would not have quickened us. If we were only hypocrites worthy of derision, as the proud ones say, he would not have revived us by his grace. An experience of quickening by the word of God is a fountain of good cheer.

See how the experience of this verse is turned into a prayer in verse 107: "Quicken me, O Lord, according unto your word." Experience teaches us how to pray, and furnishes arguments in prayer.