The answer to these questions is very simple, although not always something people like to hear.
If you have bad knees, then work out using your arms and skip the leg exercises. If you have injured shoulders, then go lighter on the arm stuff (or avoid it altogether) and just focus on the legs. Can’t use your right arm? Then use your left. Can’t use the left? Use the right. In other words move the body parts you are able to use. It may surprise you to know that research suggests that moving the non-injured limb actually does have some benefit in strengthening the limb you can’t move. This has to do with “nervous system crossover.”
If you are so injured that you can’t exercise, focus on the other parts of the program, make sure to get your movement in, and resume your exercise routine when the injury is healed enough to get back at it.