Umm Salama reported
When Abu Salama died I said: I am a stranger in a strange land; I shall weep for him in a manner that would be talked of. I made preparation for weeping for him when a woman from the upper side of the city came there who intended to help me (in weeping). She happened to come across the Messenger of Allah (ﷺ) and he said: Do you intend to bring the devil into a house from which Allah has twice driven him out? I (Umm Salama), therefore, refrained from weeping and I did not weep.
Usama b. Zaid reported
While we were with the Messenger of Allah (ﷺ), one of his daughters sent to him (the Messenger) to call him and inform him that her child or her son was dying. The Messenger of Allah (ﷺ) told the messenger to go back and tell her that what Allah had taken belonged to Him, and to him belonged what He granted; and He has an appointed time for everything. So you (the messenger) order her to show endurance and seek reward from Allah. The messenger came back and said: She adjures him to come to her. He got up to go accompanied by Sa'd b. 'Ubada, Mu'adh b. Jabal, and I also went along with them. The child was lifted to him and his soul was feeling as restless as if it was in an old (waterskin). His (Prophet's) eyes welled up with tears. Sa'd said: What is this, Messenger of Allah? He replied: This is compassion which Allah has placed in the hearts of His servants, and God shows compassion only to those of His servants who are compassionate.
This hadith has been narrated by another chain of transmitters on the authority of 'Asim al-Ahwal.
'Abdullah b. 'Umar said that Sa'd b. Ubada complained of illness. The Messenger of Allah (ﷺ) came to visit him accompanied by 'Abd al-Rahman b. 'Auf, Sa'd b. Abi Waqqas and 'Abdullah b. Mas'ud. As he entered (his room) he found him in a swoon. Upon this he said
Has he died? They said: Messenger of Allah, it is not so. The Messenger of Allah (ﷺ) wept. When the people saw Allah's Messenger (ﷺ) weeping, they also began to weep. He said. Listen, Allah does not punish for the tears that the eye sheds or the grief the heart feels, but He punishes for this (pointing to his tongue), or He may show mercy.