Repentance of One Suffering from a Terminal Disease
Question

A man committed many sins. He is suffering from a severe illness and has tried treatment to no avail. The doctors have told him that they have no cure for his problem. Now he regrets his past and wants to repent. Does his repentance count now that he is suffering from this terminal illness from which he has no hope of a cure?
Praise be to Allah.Yes, the repentance of a man who does not hope to live for long does count. This applies whether he has an incurable illness such as cancer; or he has been sentenced to death, such as a man who has been brought out for execution, even if the sword is being raised above his head; or a married man who has committed adultery and been sentenced to stoning, even if the stones have already been gathered. His repentance is valid, because Allah accepts the repentance of a man so long as the death rattle has not yet reached his throat. Allah says (interpretation of the meaning):
“Allah accepts only the repentance of those who do evil in ignorance and foolishness and repent soon afterwards; it is they to whom Allah will forgive, and Allah is Ever All-Knower, All-Wise.”
[4:17]
The meaning of the phrase “and repent soon afterwards” means that they repent before they die.
In the following ayah (verse), Allah says (interpretation of the meaning):
“And of no effect is the repentance of those who continue to do evil deeds until death faces one of them and he says: ‘Now I repent.’”
[ 4:18]
There are five essential conditions for repentance: sincerity, regret for what one has done, giving it up immediately, determination not to repeat it in the future, and repenting during the time when repentance will be accepted, i.e., before one dies or before the sun rises in the west.