In this Psalm the writer is remembering a time when the Lord had helped him in the past. The verses right before our verse say:
Unless the LORD had given me help,
I would soon have dwelt in the silence of death.
When I said, “My foot is slipping,”
your unfailing love, LORD, supported me. – Psalm 94:17-19 (NLT)
The Lord has a history with this person – He has protected him (or her) in the past. The writer recognizes that without God’s help, death would surely have been his outcome.
“Doubts” in our verse mean the thoughts that cause a person to be troubled or disquieted. And the “me” in our verse refers to the soul or inner being of a person. When our inner being is being troubled, we can rest in the fact that God will give us relief in affliction (“comfort”). Why is the Psalmist certain of this? Because God has done it for him in the past.
When we face a time of uncertainty or anxiety, it is helpful to hit the pause button and think back to a time in our lives when God did come through for us. That’s one reason why it can be helpful to keep a journal – to keep a written record of when God came through for you. In this time, remember that God has gotten you through everything else that life has thrown at you – he will get you through this as well.