(ISTOCKPHOTO)

Exercise isn’t good only for building muscle and losing weight. “If a pill could give you all benefits of exercise, it would be the best pill around,” says Edward Laskowski, co-director of Mayo Clinic Sports Medicine and a specialist in physical medicine and rehabilitation.

Yet doctors underprescribe exercise, even though research shows that it can deliver comparable benefits to drugs and surgery with fewer side effects, according to a recent review in the Canadian Medical Association Journal. Here’s how to safely get the disease-fighting benefits of exercise:

Chronic obstructive pulmonary disease

People with chronic obstructive pulmonary disease, a progressive illness that narrows airways and makes breathing difficult, might worry that exercise will make it even harder to catch their breath. But by increasing overall fitness and helping to limit weight gain, it can improve breathing and reduce fatigue, according to Albert Rizzo, chief of Christiana Care Health System Pulmonary and Critical Care Medicine Section in Newark, Del.

Getting started. If your breathing isn’t stable or you have another condition such as heart disease, your doctor may want to evaluate you before okaying exercise. And some people may need supplemental oxygen during workouts. If your COPD is milder, your doctor will either clear you to work out on your own or refer you to pulmonary rehabilitation to learn breathing techniques and exercise safety. Try to build up to four or five hour-long sessions per week, combining walking or stationary cycling with strength training.

Type 2 diabetes

Aerobic exercise and strength training can be almost as effective as some drugs in controlling blood sugar levels. For example, a 2012 study found that 9 percent of people with Type 2 diabetes who combined an exercise program with dietary changes for two years eliminated their need for medication altogether.

Getting started. To avoid low blood sugar, time your exercise around meals or insulin, and always have a sugar-rich snack handy. If you have vision problems or altered sensation in your hands or feet, make sure you’re supervised at first. Many hospitals have diabetes clinics or diabetes educators, and your doctor may be able to refer you to someone who develops workouts for people with diabetes.

Aim for 150 minutes of moderate activities such as walking, biking or swimming each week, in three to five sessions. Strength training is important, too: The more muscle you have, the less likely you are to store excess glucose as fat, says Sheri Colberg, emeritus professor of exercise science at Old Dominion University in Norfolk, and a specialist in diabetes and exercise. Try to do eight to 10 repetitions of eight to 10 different moves two to three times each week, using your own body weight or tools such as exercise bands or hand weights.

Osteoarthritis

Although the pain of arthritis, in which the protective cartilage at the ends of joints wears away, may make you want to avoid physical activity, the right exercise can ease discomfort. A 2015 review of 54 studies found that people with knee arthritis who were enrolled in exercise programs — mostly involving both aerobics and strength training, but also tai chi — reported less pain and an improved ability to perform basic daily tasks compared with those who did no exercise.

Getting started. Good form is key with osteoarthritis, to avoid muscle imbalances that can worsen discomfort. A physical therapist or certified personal trainer can show you how to perform exercises properly so that you can then do them at home or at a gym on your own. You can also check arthritis.org for arthritis-friendly exercise classes. Aim for 150 weekly minutes of low-impact activities such as walking, swimming or cycling.

With strength training, pay close attention to your leg muscles if you have hip or knee arthritis. “Strong muscles take pressure off the joints and improve stability, which can help prevent falls,” Laskowski says. If pain persists or exercise makes it worse, see your doctor.

When you’re too sick to exercise . . .

If you’re experiencing nasal congestion from allergies or a cold, or have a mild headache, working out is probably fine, although you might want to dial down the intensity and duration: Start by cutting both in half and seeing how that feels. But if you have a fever, chest congestion, or flulike symptoms such as chills, deep fatigue or muscle aches, you’re better off opting for rest. And if you have a severe headache such as a migraine or cluster headache, you probably won’t feel much like exercising, so listen to your body. In fact, that’s almost always good advice: If you feel too lousy for physical activity, skip it.

Copyright 2016. Consumers Union of United States Inc.

For further guidance, go to www.ConsumerReports.org/Health, where more detailed information, including CR’s ratings of prescription drugs, treatments, hospitals and healthy-living products, is available to subscribers.