The heart of the wise is in the house of mourning; but the heart of fools is in the house of mirth. Ecclesiastes 7:4 (KJV)
The ‘heart’ refers to the centre of anything… it may also refer to consent, will, intellect, et cetera. (H3824)[1] It seems the ‘heart’ refers to, where the focus of a person is located. Henry notes that for the wise, the focus remains on the natural state of our existence: sin, suffering, and death. Perhaps, this is why Qoheleth prefers this over empty indulgence of joy. Henry writes, “Sorrow is better than laughter, more agreeable to our present state, where we are daily sinning and suffering ourselves, more or less, and daily seeing the sins and sufferings of others.” This is why, the wise man centres himself to such state. Bartholomew writes, “The heart is the center of the person, and for Qohelet the ‘wise’ person’s center dwells in the house of mourning. Qohelet’s logic leads him to the view that the wise person is consumed with death and the fool with celebration and joy.” (212)
References:
Bartholomew, C. (2009). Ecclesiastes, Baker Academic
Henry, M. (1706). Commentary on the Whole Bible, Complete, Eccl. 7:1-6
[1] https://www.blueletterbible.org/lexicon/h3824/kjv/wlc/0-1/