Sickness and other difficulties that we undergo in this worldly life should not only be seen as a misfortune or as an expression of the displeasure of Allah Ta'ala. For those servants of Allah who enjoy a very special relationship with Him, it is a mean of great blessing and a mercy. Is there anyone in this world who is free from sins and mistakes? If every soul were to be fully recompensed for its every action, then apart from the sinless Prophets of Allah, the Ambiyaa (Alaihimus salaam), nobody else would be worthy of entering into Jannah. Man commits minor and major sins all the time, but the difficulties and hardships that he undergoes in this world like illness, grief and sorrow, etc. become the atonement for his sins and in this way he is cleansed of his sins in this very world.
Allah Ta'ala is so relenting and lenient with the Ummah of his beloved Nabi Muhammad (Sallalaahu alaihi wasallam). However, it has been observed that because of a lack of proper Deeni knowledge, very often even when a Muslim becomes ill, many incorrect statements are uttered by the sick person as well as those who treat and take care of him.
To seek a cure for one's illness and to take treatment for it is certainly not forbidden in Islam. In fact it is a Sunnah. There is also no harm if a person complains about pain in the body. However, when a person becomes sick and then complains bitterly and objects to Allah Ta'ala showing disrespect and ingratitude to Him, this amounts to destroying his own rewards.Whether we are healthy or sick, we should be thankful to Allah Ta'ala in all conditions. Life and death are in the hands of Allah Ta'ala alone.
A person who is sick should regard his sickness as a gift and a special sign of mercy from Allah. When he realises this, then at every moment he will be thankful to Allah Ta'ala. Furthermore, those who take care of the sick, like doctors and nurses, should understand firstly, that the service they are rendering will certainly earn them great sawaab (reward from Allah) and secondly, that they are fulfilling a part of huqooqul ibaad (i.e. the rights of the creation of Allah).
Every Muslim doctor, nurse and sick person should learn what our Beloved Nabi, Muhammad (Sallallaahu Alayhi Wasallam) has said regarding illness and disease. Our Nabi (Sallallaahu Alayhi Wasallam) has taught us that a person is tested according to the level of Deen present in his life. If he is firm on his Deen then the test is correspondingly severe, and if he is weak on his Deen then the hardship is made easy upon him. (Tirmizi, Ibn Maajah)
Aa'isha (Radiyallaahu anha) says, 'I have never seen anybody suffering from sickness as much as Allah's Messenger (Sallallaahu Alayhi Wasallam).' (Sahih Bukhaari)
Hadrat Aa'isha (Radiyallaahu anha) also narrates that Rasulullah (Sallallaahu Alayhi Wasallam) said, 'When the sins of a person become so much that his good deeds are unable to wipe them out, then Allah Ta'ala lets grief overcome him in order to forgive his sins.' (Musnad Ahmad)
Similarly, Hadrat Abu Hurairah (Radiyallaahu anhu) reports that Rasulullah (Sallallaahu Alayhi Wasallam) said, 'When Allah Ta'ala wishes good for a person, then he becomes afflicted with sickness (or hardship).'(Sahih Bukhaari)