Sayyiduna Mu'adh bin Jabal (may Allah be pleased with him) narrates that the Prophet (peace and blessings be upon him) said: "There are five deeds such that if a person does any one of them, he will be under the guarantee of Allah Almighty: whoever visits a sick person, or goes with a funeral, or goes out to take part in battle, or goes to an Imam with the intention of supporting and honouring him, or remains sitting in his house, so that people remain safe from him and he remains safe from people."
Tabarani recorded it in al-Mu'jam al-Kabir. Its chain contains Ibn Lahi'ah, and there is criticism (kalam) regarding him. The rest of its narrators are thiqat (trustworthy). (Allamah Haythami says:) I say: Another route of this narration will also come in the chapter on the virtue of jihad.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الجنائز / 3784