All sentient beings enjoy happiness but loath suffering. But suffering is also part of our lives. Much as we may detest suffering, no one can avoid suffering in their lives. Even if they never had to go to a hospital, at the end, most people cannot avoid it in the end. However, there are ways to look at our suffering/pain from a different perspective to make it more tolerable and even make it more meaningful.
Here are a few words from a great meditator of TIbet known as Shapkar or white feet.
Homage to the Lineage of Gurus!
May adversity turn into a path of redemption,

Listen, meditator (to obese self),  When I experience pain,

And feel like how I wish I don’t have to experience this,

Realise, (understand) that if you don’t wish to experience suffering,

and want to enjoy happiness, this present predicament is signalling you that in order to achieve happiness and freedom from suffering, you have to create the causes and therefore create the merit to achieve the goal.

Therefore, make offerings to the Buddha, Dharma and Sangha.
Practice generosity and give to the poor. Feeding the spirits etc

Put your mind body and speech to good use to create merit.
Offer mandala to the three jewels, take refugee and generate the Bodhi-mind, Pray, if it is good for me to be sick, may I be sick,
if it is good for me to be alive, may I be alive,

If it is good for me to die, may I die.
I pray without expectations.
The present predicament ( being indisposed) is signalling, if you don’t wish to suffer, avoid the cause of suffering such as committing a sin,

And thus feel great sense of remorse for the sins one has committed like a person who feels immense regret after swallowing poison.
Make a resolution never to commit such sins or negative acts ever even at the cost of ones life.
often take refuge and generate the Bodhi-mind, meditate on emptiness and recite mantras.
Feel a sense a gratitude towards the being (spirit) who was harming because this beings harm that came on my way, was instrumental in helping me to think of the Bodh-mind. Pray too that all the sufferings of the sentient beings ripen upon me. If one is able to do this, all adversities can be turned into Dharma practice. So, there is no need to be unhappy or despondent when sickness or unfortunate things happen to us.

I have simply translated the great meditator’s words. They are simple and nothing too difficult to understand. What he has explained is what we call the four opponent powers which is indispensable for the purification of our negative karmas.  I translated the word “sin” which I meant negative karmas or black deeds. The gist of the message is, if things go wrong in your life, don’t get so upset or despondent. Look at it as a blessing because in our daily life, when everything is fine, we hardly ever think of the Dharma let alone practice. But as soon as we are taken ill, we start thinking of something Devine that can intervene and help us. That’s why, getting sick or when things go wrong in our lives, it should be treated as signalling us that these things have happened because of the causes which had been already sown. Therefore, if we want to avoid such unpleasant experience in future, we have to avoid creating the causes and that’s why feeling immense remorse and the commitment to never do them again are the tools with which we purify the bad karmas. Feeling remorse but at the same time seeing it as a Devine signal to make offerings to  the higher beings and practice generosity by giving to the poor helps us to create the cause to achieve the happiness we are all seeking. The present predicament, whatever it may be,  therefore enables us to do these things and therefore it should be seen in the light of benefiting us rather than harming us. If we are able to develop this mentality. it helps us to bear the difficulties with fortitude. So, tragedies, sickness and all unpleasant things should be seen as messengers or a wake up call to do good for our own benefit. We have a choice to develop our capacity to withstand tragedies and physical indisposition in a much more healthy way instead of being wrapped up in misery. It will not come automatically. It is a mind training. We have adapt this kind of attitude each time we face problems. It will gradually take root and we become more attuned to this way of looking at it. This then helps us to deal with the issue in hand in a more holistic way taking away the fear,  apprehensions and anxiety.
Here, I used the word Devine. While it is our own karma,  why it has happens in such and such time can be seen as signal from ones own Lama or Buddha to give us a wake up call.