Our societal view of sickness perhaps around four years ago was entirely different from what it is now. Years ago if I had a mild cold I might have still gone to Mass but nowadays it feels a little bit wrong to go even with just a slight cough. Regardless of that I recently got a pretty bad head cold and was considering whether it would be right to miss Mass. This interior struggle is something common to Catholics who are faithful to the Sunday obligation. Some have an easier decision to make than others though. Luckily the Church gives a guideline for Catholics in this regard.
It is said in the Catechism of the Catholic Church that under certain grave reasons, sickness being one, it can be ok to miss Mass (No. 2181). However it leaves the decision up to the conscience of the individual Catholic as to how sick they have to be. This of course can lead to questions especially from Catholics more on the scrupulous side. A good rule of thumb I found was this: if you are unwell enough that you would call in sick for work it is probably best to not go to Mass. This is not just for your own health but the health of others if you are contagious. If it is some longer term non-contagious ailment then it also falls to the conscience. Something like a hip injury could be a reason to stay home or a suffering you offer up, it depends on the gravity of the injury and your choice. Certainly, missing Mass is not something to consider lightly so do not make excuses if you are in fact well enough to go. Many Catholics around the world do not have the opportunity to attend Mass every Sunday so do not take it for granted. Likewise if you are definitely unwell don't force yourself to go. Going to Mass while nauseous or while coughing up a lung will not provide for a prayerful experience for yourself or others.
If you are sick and cannot go there are some things you can do at home or with your family to at least feel connected to the Mass. One thing now popularized is the streaming of Masses online so it is quite easy to find one to watch. While this does not fulfill the Sunday obligation it still connects you to the Liturgy. If you are devoted to the Latin Mass it is quite easy to follow along with the Missal. You could meditate upon the readings from Mass that you might not otherwise have thought about. The Rosary also is a good devotion for every day but especially when we are not able to attend Mass. Its meditative aspect helps the mind stay focused on Christ and the mysteries of His Salvific work. Lastly, prayers of Spiritual Communion are a good practice both for life in general and when we miss Mass as by saying them we invite Christ to dwell in us spiritually.
While missing Mass can be upsetting it is comforting to know that we are not condemned for it if we have a legitimate reason. It is also good to know that there are other ways we can show devotion to God if stuck at home so that as soon as we can get to Mass we are more than ready to receive the graces found there.