Pruning is not a good remedy for every cactus that looks sick. The cactus may not be sick, but disfigured in some way. For example, natural stem corkiness is a consequence of aging and doesn't hurt the plant. Sunburned plants develop scars from death of the scalded skin, but plants can recover and continue to grow. Prune when you need to remove diseased tissue before it spreads, reroot a cactus with dead roots or eliminate insect pests.
Both bacterial and fungal rots attack cacti. Often by the time you can see rot symptoms, they've spread too far for pruning to save the cactus plant. If the bottom of the cactus is rotten but the top is still green, cut off the top well above the discolored base. Check to see if the top has any discoloration or browning inside. If it does, continue to cut pieces off until the tissue is clean, and dust the wound with bleach-containing scouring powder. Disinfect your tools with rubbing alcohol or a solution of 1 part household bleach to 10 parts water before pruning, between each pruning cut and again when you finish. Allow the wound to heal and reroot the top. If there are pockets of rot along the stem, carve out the diseased tissue, and then clean the wound with the bleach solution and let the tissue heal over. Use the same tool-cleaning precautions. Discard all infected plant parts.
If frost-tender cacti experience a hard freeze, the damage usually depends on the size of the plant and the length and severity of the cold exposure. Small plants are usually killed outright. Larger plants may experience partial die-back. Don't prune the damage until several days, or for large plants, weeks have passed so you can be sure of the extent of the damaged tissue. Take off dead or rotten portions, again inspecting the internal tissue and making cuts until all discoloration is gone. If rot sets in, prune the plant immediately, using clean tools.
Sometimes insect infestations such as mealybugs, scale insects or internal borers become so serious that it's better to cut off and discard the affected areas. For mealybugs, remove affected areas from the cactus when wind isn't blowing so the tiny eggs and crawler stages don't get blown onto uninfected plants. The South American cactus moth (Cactoblastis cactorum) has brightly colored orange and black caterpillars that bore into plant pads. Used in Australia to control invasive prickly pears, it is spreading as a pest to North America. The moth threatens rare and endangered native American prickly pears (Opuntia engelmannii), which grow in U.S. Department of Agriculture plant hardiness zones 8 to 11. Be watchful for infections, and remove and discard pads with egg cases or larvae.
Inexperienced cactus growers often don't give plants enough light, and the new growth stretches out abnormally and becomes etiolated -- what should be a pad looks like a green bean, and a formerly cylindrical cactus develops a needle-nose top. To resurrect proper, healthy growth, prune any pale, skinny growth back to normal-looking areas. Gradually, over the course of a couple of weeks, accustom the plant to brighter light levels where it will eventually put out new, normal growth.