This is almost entirely a karmic dilemma. People who have an untroubled life will typically have a smooth passage. There may be some illness at the end stage to reduce their stamina and overall healthy status as a kind of facilitation to move in that direction, but it will not be anything like those who languish for many months, and even years, in a chronic state of ill health and infirmity that greatly hampers quality of life and, in effect, is frank torture in many cases. That is owing to the forces of karma, in a sense, holding them over the fire for a time before letting go of them so they can proceed on their soul journey.
It appears quite cruel to the observer, but that is because you do not see all of the prelude leading up to this eventuality, nor understand the fine workings of karma in demanding a kind of restitution, in many instances, for prior misalignments whether as perpetrator or victim. Both can end up causing further pain and suffering to recapitulate in other lifetimes—one, to have a taste of that particular medicine they doled out, and the other, the trap created by self-denial and self-hatred—putting the person back in the same dilemma with the intention to be a motivation to look for ways to heal it and overcome the faulty thinking at the risk of worsening things and further grooving in the pattern. The latter happens half the time and so this is how people come to great levels of suffering and exhibit the most horrendous series of calamities and intractable sources of limitation and discomfort, and seem quite pitiable in that extreme. That is the point karma is making—wake up and see the dilemma for what it represents and take action to do something about it at long last.
Turning to science and medicine will not be an answer for such individuals. To be sure, there are palliative measures that can be taken, including for those warranted, powerful painkiller medication as a humanitarian act at the expense of some potential health liability with long-term use. There is no desire of divine realm to see people suffer. When we say it is your doing, we truly mean this. Forgiveness is available to all, regardless of past experiences and actions. There only needs to be an act of restitution, or desire to do so, and an outreach to the divine asking for help with a realization this is sorely needed, and they surrender their own desire and will to keep their problem going by that recognition that a higher power is called for—that can be all that it takes to have healing commence.
But many times, it is not that simple and the major barrier in such cases is when the mind itself is convinced the person is doomed to suffer and is a decree that the divine realm cannot countermand. After all, you are the ruler of your kingdom and your word is law, even if it acts against your best interests. This is why a human advocate can be so very valuable to step in and act on someone’s behalf to begin to suggest alternatives, as we cannot do this because it would be leading the person and thereby controlling their lives in some respect. Humans can make an offering of alternatives in a very direct way, and if the mind finds the idea attractive and agrees to move in that direction, it can create a turning point for the better.