Abdullah bin Umar reported,

Saad bin Ubada fell seriously ill, so the Prophet ﷺ came to visit him along with Abdul-Rahman bin Awf, Saad bin Abu Waqqas, and Abdullah bin Masud رضي الله عنهم. When the Prophet entered and found him surrounded by his grieving family, he said, "Has he passed away?"They replied, "No, Messenger of Allah."The Prophet ﷺ then wept, and when the people saw him weeping, they wept as well. He said, "Do you not hear? Allah does not punish for the tears of the eye nor for the grief of the heart, but He punishes for this," and he pointed to his tongue, "or shows mercy. And the deceased is indeed punished because of his family's wailing over him."Umar رضي الله عنه used to strike anyone who did so with a stick, throw stones, and toss dust at them.

Bukhari 1304

Sahih

حدثنا أصبغ عن ابن وهب قال أخبرني عمرو عن سعيد بن الحارث الأنصاري

عن عبد الله بن عمر رضي الله عنهما قال

اشتكى سعد بن عبادة شكوى له فأتاه النبي ﷺ يعوده مع عبد الرحمن بن عوف وسعد بن أبي وقاص وعبد الله بن مسعود رضي الله عنهم فلما دخل عليه فوجده في غاشية أهله فقال قد قضى قالوا لا يا رسول الله فبكى النبي ﷺ فلما رأى القوم بكاء النبي ﷺ بكوا فقال ألا تسمعون إن الله لا يعذب بدمع العين ولا بحزن القلب ولكن يعذب بهذا وأشار إلى لسانه أو يرحم وإن الميت يعذب ببكاء أهله عليه وكان عمر رضي الله عنه يضرب فيه بالعصا ويرمي بالحجارة ويحثي بالتراب

البخاري 1304صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Funerals
Chapter
Weeping in the presence of the sick
Numbering
Darussalam 1304
Bukhari 1304