The second beatitude in Matthew is
Blessed are those who mourn,
for they will be comforted.
Some bible scholars identity Isaiah 61 1:7 as the passage Jesus had in mind in the beatitudes. That old testament passage has ‘ He has sent me to bind up the brokenhearted… to comfort all who mourn…’
At the time of Isaiah the Jewish people were in exile in Babylon and mourning. Psalm 137:1 says
By the rivers of Babylon we sat and wept
when we remembered Zion.
By the time of Jesus they were back in Palestine but ruled over by the Romans and awaiting their Messiah. Some thought the Messiah would be a King to make the Jewish people great.
We all have times of mourning when we loose somebody. We may also mourn over events in the world where people suffer through no fault of their own. We are called to be like Jesus and bring comfort to those who mourn.