"The basic principles of medicine are three: prevention, maintaining good health, and removing harmful substances from the body.
Allah has mentioned them all together, to His Prophet and his ummah in three places in His Book.
1) He prevented the sick person from using water lest it harm him, as He says:
“And if you are ill, or on a journey, or one of you comes after answering the call of nature, or you have been in contact with women (by sexual relations) and you find no water, perform Tayammum* with clean earth and rub therewith your faces and hands (Tayammum)”
(Qur’an, al-Nisa’ 4:43)
Allah allowed the sick person to do tayammum to protect him, just as He permitted it to the one who has no water.
2) Allah says concerning the maintenance of good health:
“and whoever is ill or on a journey, the same number [of days which one did not observe Sawm (fasts) must be made up] from other days”
(Qur’an, al-Baqarah 2:185)
The traveller is allowed to break his fast during Ramadaan, to protect his health lest the combination of fasting and the difficulties of travel weakens him and affects his health.
3) And Allah said concerning the removal of harmful things by shaving the head of the person in ihraam** (for Hajj or ‘Umrah):
“And whosoever of you is ill or has an ailment in his scalp (necessitating shaving), he must pay a Fidyah (ransom) of either observing Sawm (fasts) (three days) or giving Sadaqah (charity — feeding six poor persons) or offering sacrifice (one sheep)”
(Qur’an, al-Baqarah 2:196)
So if a person has an ailment in his scalp when he is in ihraam, he is permitted to shave his head and remove the harmful thing or the bad substance that is causing lice to develop – as happened to Ka’b ibn ‘Ajrah – or if it is causing sickness to develop.
These three matters are the basic principles of medicine. We have mentioned an example of each one in order to point out the blessing of Allah to His slaves in preventing sickness, protecting their health and removing harmful substances from them, as a mercy and kindness towards His slaves, for He is the Most Kind, Most Merciful.
-Ibn al Qayyim, (Zaad al-Ma’aad, 1/164, 165)
*Tayammum: ritual ablution/purifying oneself for prayer using dry dust or rocks.
**Ihraam: entering a ritual state