It is narrated from Sayyiduna Abu Sa'id al-Khudri (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Visit the sick and follow the funerals; these (deeds) will remind you of the Hereafter."
Abu Dawud al-Tayalisi, Abu Bakr bin Abi Shaybah, Ahmad bin Mani', Abd bin Humayd, al-Harith bin Abi Usamah, Abu Ya'la al-Mawsili, Ahmad bin Hanbal, al-Bazzar, Ibn Hibban in his Sahih and al-Bayhaqi in al-Sunan al-Kubra recorded it, while the basis of this hadith is found in the two Sahihs (Bukhari and Muslim) and elsewhere from the narration of Sayyiduna Abu Hurayrah (may Allah be pleased with him) and other Companions.