It is better to go to the house of mourning
than to go to the house of feasting,
for this is the end of all mankind,
and the living will lay it to heart.
Sorrow is better than laughter,
for by sadness of face the heart is made glad.
The heart of the wise is in the house of mourning,
but the heart of fools is in the house of mirth.
Better is the end of a thing than its beginning,
and the patient in spirit is better than the proud in spirit.
Qoholeth, the writer of Ecclesiastes, sees with great wisdom in Ecclesiates 7. The house of mourning and bereavement helps us to see the lot of every person, in the end, before we die. Thus we all need to take it to heart and consider what our end on this earth will be. Although there is an end on this earth, it is not the end. Eternity begins at death, which will it be?
How is the heart made glad by sadness of face? This I believe only happens for the wise, who take death to heart and consider their end. The gladness comes from a security of heart in the knowledge of eternity with God for one who trusts Him as their Lord and Savior.
The end is better than the beginning, because although the beginning can be filled with excitement and anticipation, the end brings reality and wisdom. Seek that wisdom that comes from God and his Word, the Bible.