Visiting sick friends either at home or in the hospital is a sign of thoughtfulness. However, if you do not follow visiting etiquette (yes, there is such a thing), then it could just do more harm than good.
Call the hospital or the relative first before going. Find out if there is a specific time that you are allowed to visit.
Spend a few minutes (a maximum of half an hour) with them so as not to overexcite or exhaust the patient. Remember that the patient cannot fully rest if there are people around.
Speak in a soft tone so as not to disturb the patient and other patients as well. Turn your phone off or turn it into silent mode.
Talk about pleasant things. Depressing stuff can only make the patient feel worse. Cheer them up by bringing flowers or a stuffed toy. You can also bring a book or magazines, if they are allowed to read.
Leave when a nurse or aid comes in to administer to the patient to give them enough privacy.