What does Matthew 5:4 mean?

Matthew 5:4 KJV
Blessed [are] they that mourn: for they shall be comforted.

Matthew 5:4 NKJV
Blessed [are] those who mourn, For they shall be comforted.

Matthew 5:4 MKJV
Blessed [are] they that mourn! For they shall be comforted.

Matthew 5:4 KJV 2000
Blessed are they that mourn: for they shall be comforted.

Interlinear KJV

Blessed /makarios/ are they that mourn: /pentheo/ for /hoti/ they /autos/ shall be comforted. /parakaleo/

Albert Barnes’ Commentary

Verse 4. Blessed are they that mourn. This is capable of two meanings: either that those are blessed who are afflicted with the loss of friends or possessions; or that they who mourn over sin are blessed. As Christ came to preach repentance, to induce men to mourn over their sins, and to forsake them, it is probable that he had the latter particularly in view, 2Co 7:10. At the same time, it is true that the gospel only can give true comfort to those in affliction, Isa 61:1-3; Lu 4:18. Other sources of consolation do not reach the deep sorrows of the soul. They may blunt the sensibilities of the mind; they may produce a sullen and reluctant submission to what we cannot help; but they do not point to the true source of comfort. In the God of mercy only; in the Saviour; in the peace that flows from the hope of a better world, and there only, is there comfort, 2Co 3:17; 5:1. Those that mourn thus shall be comforted. So those that grieve over sin; that sorrow that they have committed it, and are afflicted and wounded that they have offended God, shall find comfort in the gospel. Through the merciful Saviour those sins may be forgiven. In him the weary and heavy-laden soul shall find peace, (Mt 11:28-30;) and the presence of the Comforter, the Holy Ghost, shall sustain us here, (Joh 14:26,27) and in heaven all tears shall be wiped away, Re 21:4.

{y} “mourn” Isa 61:3; Eze 7:16
{z} “for they shall be comforted” Joh 16:20; 2Co 1:7