In cases of dementia, the decision about timing is crucial
In many places now, Medical Assistance In Dying (MAID) is available to people with terminal illnesses who have the mental ability to choose to die and who wish to have medical assistance in doing so. I think this is a very humane way for people to end or avoid pain and suffering from incurable illness.