The Messenger of Allah ﷺ commanded us with seven things, to visit the sick, to follow funeral processions, to bless the one who sneezes, to support the weak, to help the oppressed, to spread the greeting of peace, and to fulfill the oath of the one who swears... the hadith continues.
أمرنا رسول الله ﷺ بسبع: بعيادة المريض، واتباع الجنائز، وتشميت العاطس، ونصر الضعيف، وعون المظلوم، وإفشاء السلام، وإبرار المقسم… الحديث.
Bukhari related it in the Book of Seeking Permission (6235), and Muslim in the Book of Clothing and Adornment (2066), both through the route of Ashath bin Abu Shatha, from Muawiya bin Suwayd bin Muqarin, from Bara bin Azib, who narrated it. The wording given here is Bukhari's, and Muslim went further in bringing out its various routes and wordings.