I have felt the Spirit work in this capacity innumerable times. Almost daily. What can I say--I'm an emotional kind of person. The Holy Ghost sends comfort in so many ways. And I know that each way is from the Lord. He is the one who knows how to reach, how to help. He sends the Holy Spirit to achieve those ends with us. I don't know how it all works, but I know it does.
There was a time that I was struggling (again) with my single situation. This was over a decade ago, when I was first coming to grips that life was not going as I had hoped, planned, and dreamed about. I deal with it scads better now than I did then. Possibly because of a valuable lesson I learned. I prayed quite a bit then about my situation. Over and over. I wasn't sure what to do, what to change. I just cried and prayed a lot. I was in the waiting area in the temple, waiting for friends whom I had just served with to come out. I felt I should look in the scriptures. So I opened them and managed to read one verse when my friends showed up. I closed the book and we left. But a couple of minutes later, it finally dawned on me what I had just read in Doctrine and Covenants 59:22:
Behold, this is according to the law and the prophets; wherefore, trouble me no more concerning this matter.
The Spirit's message was so clear--stop bothering the Lord! He wants to hear from us. He wants us to bring our joys as well as our troubles to Him. But I had wearied Him with my constant crying and complaining--but especially my lack of doing! One would wonder how this chastisement would bring me comfort. I feel that the Spirit directed me to this scripture because it 1) reminded/testified to me that the Lord is ever mindful of me (which is one of the most comforting things in this world) and 2) prodded me to do something about my situation. Me doing something helped to keep me from being so low about being single and unsought after. Not that I could change that I was single. But it was the very beginning of a long road to learn how to make my own happiness and not let uncontrollable circumstances affect my outlook on life.
It's an odd example, yes. But I wanted to point out that the Spirit brings comfort in many ways--and that comfort can be found in many things if only we are in tune to recognize it, apply it, and hold to it.