If you have a splitting headache, lying down with an ice cold cloth on your head is sometimes the only way to numb the pain; but when your grandma’s back aches, she can’t live without her heating pad. Both cold and heat are used to alleviate pain — whether it’s from an injury or arthritis — but which are best to use for certain conditions?

For some, it may be a matter of preference, but recent guidelines from the American Physical Therapy Association note that using heat or cold in the wrong way could actually be harmful. In particular, they explain that using such “passive” therapies instead of helping patients manage more physical activity could make pain worse.

Still, ice packs can help reduce inflammation and swelling right after a sports injury, as well as numb the pain of a headache. And for arthritis patients, heating up joints can help them move around more easily. To help you choose a treatment, the Cleveland Clinic has come up with an infographic that delineates different types of pain, and their best icy or hot treatments.

As someone with arthritis, fibromyalgia and chronic headaches, this chart is one of my favorite finds.

Here’s the main thing to remember: Typically for inflammation, like chronic inflammatory arthritis, ice is best. Ice also works for recent, acute injuries that are swollen, because it restricts blood vessels and lowers the amount of fluid rushing to an injury. “Ice seems cold, mean and uncomfortable,” Anne Rex, a physician at the Department of Orthopedic Surgery at the Cleveland Clinic, said. “But ice wins for acute pain, inflammation and swelling. Heat perpetuates the cycle of inflammation and can be harmful.” When icing an injury, take breaks every 20 minutes.

Heat, in the meantime, is typically better for long-term, chronic pain — like arthritis in your joints. “Patients with more chronic osteoarthritis usually feel better with heat,” Dr. Linda Mileti, a rheumatologist at the Cleveland Clinic, said.

Heat is relaxing; it can help reduce stiffness and tightness in joints and muscles, something that anyone who’s taken a long hot shower to unwind can attest to. Heat is also used after an injury, in the days that inflammation has already been reduced, but there’s still stiffness.

Next time you have an injury, headache, or your arthritis is acting up again, choose wisely in employing heat or ice packs. They will not treat the underlying problem, but they can reduce pain and make you more comfortable in the meantime; and check with your doctor to make sure whether rest or some physical activity will be helpful in treating your acute or chronic pain.