A common question, and surprisingly tricky to answer. To start with, it’s a question of realising that cold and heat have two entirely different effects: blocking and healing.
Both cold and warmth act as pain blockers. In other words, rather like rubbing a stubbed toe, they distract the brain from feeling the usual pain or ache. But they do something else too.
Cold can seep through the skin, and serve to slow down the inflammatory activity and blood flow in a painful area. This works when inflammation is causing the bulk of the pain, which is mainly in the first few days of a new injury.
For example, you’ve stretched a joint too far, the joint becomes inflamed, and you get pain and a hot feeling over the following few days.
Warmth is good for muscles. It can relax them, allowing greater blood flow. This is especially useful when muscle tension is causing the ache or pain, and there is no inflammation.
Rule of thumb
A neat way of remembering all this is: warmth is right when movement makes you feel better, and cold is right when you would rather not move because of the pain.
Both cold and warmth have different and similar effects. And you can use both in different places at the same time. For example, a warm water bottle on an achy muscular area on one side of your back, and a cold source on the hot, sore other side.
Careful not to use too much heat over an already inflamed area. You might feel temporarily better, as the heat blocks the pain signals, but at the cost of increasing inflammation later on.