This one seems like a no-brainer, because it's followed by "for they shall be comforted." But of course there is more to it, as there always is with Sacred Scripture.
One of the hardest things to do, for me, is to comfort people who are in mourning. I mean, it's easy enough to say, "my condolences" and "we're so sorry for your loss." I don't know, maybe that's enough sometimes, but it feels like it's not, and you always wish you could say or do more to comfort them.
There is a recurring reading from the Common of Martyrs in the Liturgy of the Hours. I think it's the best I can offer.
Blessed be the God and Father of our Lord Jesus Christ, the Father of compassion and God of all encouragement, who encourages us in our every affliction, so that we may be able to encourage those who are in any affliction with the encouragement with which we ourselves are encouraged by God. For as Christ’s sufferings overflow to us, so through Christ does our encouragement also overflow. (II Cor 1:3-5)The mystery of mourning, and suffering, is a deep one before which we are humbled. The Psalms give us comfort in times of mourning. Simply praying and reading Scripture can make a big difference. Praying the Liturgy of the Hours daily can lay a great foundation to lean upon in such times, such as this from the Office for the Dead:
Behold, I tell you a mystery. We shall not all fall asleep, but we will all be changed, in an instant, in the blink of an eye, at the last trumpet. For the trumpet will sound, the dead will be raised incorruptible, and we shall be changed.For that which is corruptible must clothe itself with incorruptibility, and that which is mortal must clothe itself with immortality. And when this which is corruptible clothes itself with incorruptibility and this which is mortal clothes itself with immortality, then the word that is written shall come about:c“Death is swallowed up in victory.Where, O death, is your victory?
When we are mourning, we can lean on our hope, this sure hope we have through faith, and in that, we see a mystery that in human wisdom is foolishness--that our mourning is an occasion for our faith, hope, and ultimately joy. It doesn't mean that we do not truly mourn but that our mourning is not the final word.Where, O death, is your sting?” (I Cor 15:51ff)