The Messenger of Allah ﷺ gave us a charge concerning five things. Whoever does any of them has a guarantee from Allah. Whoever visits a sick person, or walks in a funeral procession, or goes out to fight in the cause of Allah, or visits a ruler intending to honor and respect him, or stays in his home so that people are safe from him and he is safe from them.
عهد إلينا رسول الله ﷺ في خمس من فعل منهن كان ضامنا على الله: من عاد مريضا، أو خرج مع جنازة، أو خرج غازيا في سبيل الله، أو دخل على إمام يريد بذلك تعزيره وتوقيره، أو قعد في بيته، فيسلم الناس منه ويسلم.
Imam Ahmad narrated it (22093) from Qutayba bin Saeed, who said, "Ibn Lahia narrated to us, from Harith bin Yazid, from Ali bin Rabah, from Abdullah bin Amr bin As, from Muaz," and he related it. Ibn Lahia is in the chain, and he did become confused in his later years, but some scholars of knowledge have said that Qutayba bin Saeed was also among those who heard from him before that confusion set in, and moreover he was not the only one to narrate it.Ibn Khuzayma narrated it (1495), and from him Ibn Hibban in his Sahih (372), from Saad bin Abdullah bin Abdul-Hakam, who said, "My father narrated to us, saying, Layth bin Saad narrated to us, from Harith bin Yaqub, from Qays bin Rafi Qaysi, from Abdul-Rahman bin Jubayr, from Abdullah bin Amr, from Muaz," in similar wording, except that in place of "whoever goes out with a funeral procession" he put "whoever sets out morning or evening to a masjid."Hakim also reported it (2/90) through the route of Layth bin Saad, and said it is sahih. I say, it contains Qays bin Rafi Qaysi, whom Ibn Hibban mentioned in Thiqat (5/315), and he is "acceptable" (maqbul) according to Hafidh, meaning if he is corroborated, and he has indeed been corroborated regarding the substance of the hadith.