The Torah states “After Hashem, your G-d shall you walk”. Can one walk behind Hashem’s presence? one must follow the attributes of Hashem... Just as Hashem visited the sick, as the verse states, “And Hashem appeared to him in the plains of Mamre,” so should you visit the sick. The general rule is that we must act with the attributes of loving kindness to others which includes the Mitzvah of visiting the sick.
This Mitzvah appears in the Gemara a few times in various places (Nedarim 40a Baba Metzia 30b and more). So to learn the simple ruling as brought in the Noahide Code or the Rambam is permitted. But to delve into the Talmud and investigate the various sources deeply is prohibited.