Visiting the Sick
In section 335 of Yoreh Deah, the Tur brings a number of explanations for the requirement of visiting the sick and for the details of this mitzva. All of the explanations come from the early Sages, yet the way the Tur presents them seems to highlight the contrasts and even paradoxes among them.
The Tur cites Shabbat 32a, "R' Yitzchak son of R' Yehuda said, a person should always seek mercy so that he shouldn't fall sick, for if he becomes sick they say to him, present some merit to exempt yourself." This source suggests that getting sick is an omen, a time of heightened judgment.
The Tur then continues, citing Sota 14a, "And once a person is sick, it is a mitzva to visit him, for so we find that the Holy One, blessed be He, visits the sick, as they inferred from the verse 'And Hashem appeared to him [Avraham] in Elonei Mamre' - this teaches that He came to visit the sick". From this source, illness sounds like an occasion for unique Divine closeness and favor. We certainly don't find that Avraham is asked to "bring a merit" to exempt himself, and we would find it hard to imagine what so righteous a person would be judged for.
The Tur mentions a seemingly unrelated reason for visiting, namely attending to the needs of the patient, and then goes back to the first, "ominous" reason. He writes that a visit should be carried out "even he is a cohort, who takes with him one sixtieth of the illness." This idea of a cohort reminds us of a recurring theme in Chazal, namely that members of a group are often judged together. "If one of a group dies, all the members of the group should worry" (Shabbat 106a, SA YD 394:5). By associating himself with the sick person, the visitor includes himself in his "group" and thus judgment; this slightly endangers the visitor but even more does it lighten the judgment of the patient, as the community is always judged more leniently than the individual. (See Rambam Teshuva 2:6.)
Then back again to the Divine favor approach: "[The visitor] should not sit on a bed or chair or bench [high above the patient], rather he should wrap himself and sit before him, for the Shechina is above the head of the sick person".
At the end the Tur mentions the importance of praying for the sick person and encouraging him to mend his ways and take care of any important unfinished business. For instance, perhaps there is money which he borrowed and neglected to return.
One way of understanding this seeming zig-zag in the Tur is to recall that being in God's favor and being in a state of heightened judgment are not really opposites at all. Part of the privilege which Israel as a whole enjoys is having a unique level of Divine Providence, including a closer level of scrutiny and judgment "The Holy One blessed be He is strict with those surrounding Him even to a hair's breadth" (Yevamot 121b). Note the use of the word "surrounding" specifically those who are close to Him are subject to this strict accounting.
This is one reason that any religious act that has the nature of "approaching" God is done with great awe and trepidation. The heightened scrutiny and judgment involved may be beyond our merits. However, we should certainly not belittle the importance of any such occasion, even if we do not initiate it. As the Tur explains, illness can be a sign of Divine scrutiny leading to a greater degree of judgment, thus the sick person may be asked to present some merit. This scrutiny can apply to the patient and also to those in his family or group. At the same time, this degree of closeness is also a unique privilege, and visitors should be aware that the Divine Presence is above the sick person's head. The visitor should welcome the opportunity to participate to a limited "one-sixtieth" level in this "visitation", with of course an appropriate sense of awe.
The main thing is for the sick person and those around him in his "cohort" or "group" to use the illness as a prod to improve their ways. This includes both their spiritual level, as reflected in the requirement that visitors pray for the sick person and that he should repent, but also everyday acts of righteousness and kindness: taking care of the physical needs of the patient and urging him to arrange workaday affairs such as paying off debts.