First of all, Islam does encourage Muslims to be careful about their health. Sick people should look for a treatment for their sickness. In this context, the Prophet (peace and blessings be upon him) is reported to have said, O servants of Allah, seek treatment, for Allah has appointed cures for all diseases (Abu Dawud). Islam does not burden people beyond their capability. Therefore, incapable, sick, and disabled people are held less accountable for the rules of Shari`ah according to their condition.

Sheikh Ahmad Kutty, a senior lecturer and Islamic scholar at the Islamic Institute of Toronto, Ontario, Canada, states the following: If one’s condition is curable, they should definitely seek the appropriate cure. If it is not curable, then they must accept it as part of Allah’s will, pray that He grant patience, and make patience a source of expiation and redemption.
One should be comforted to know that in Islam we are not accountable for actions or words which we do when we are not in our right senses. We are perfectly forgiven. So one suffering from dementia need not worry about the consequences of their actions as long as they are not choosing to do them and they are not according their own free choice and will.
Having said this, I must also stress that one must consistently pray to Allah to heal oneself. We can do so by using ordinary du`aa’s such as, ” As’aluAllaha Al-`Azheem R abba Al-`Arshi Al-`Azheemanyashfiyanee” (I ask Allah, the Lord of the Mighty Throne, to cure and heal me).

Also, as often as we can, read Al-Fatihah and the three last surahs of the Qur’an and then blow into our hands and wipe your hands all over our body.