Our Sages said: “Whoever visits the sick is spared the punishment of Gehinnom, as it is written (Tehillim 41:2), Praiseworthy is he who contemplates the needy, on the day of evil Hashem will deliver him” (Nedarim 40a). The “needy” mentioned in the verse refers to a sick person, and “the day of evil” refers to Gehinnom. In addition, the visitor receives reward in this World, as alluded in the next verse: Hashem will preserve him and restore him to life, and he will be happy on earth (Tehillim 41:3). Our Sages explain that Hashem “will preserve him” from the Evil Inclination, and He will “restore him to life” from having suffered tribulations, and “he will be happy on earth” — that all will honor the person.
Conversely, the sin of one who is lax about this mitzvah is very great — so much so, that Rabbi Akiva said that whoever does not visit the sick is considered as though he has shed blood, because when people come to visit the sick person they take care of all his needs and, perhaps, had the fellow who could have visited actually come, he could have suggested some remedy that would have saved the life of the patient, or the like.