Knowing when to use ice and heat for pain is knowing what type of injury you have.
If you have an acute injury or an injury that just happened – ankle sprain or ankle swelling. First, make sure that it is nothing more serious like a broken bone, and then apply ice. You never want to apply heat to an area that is swollen.
Heat can help an injury once swelling has gone down or if the injury is a chronic injury - runner's knee or chronic low back pain. Heat the area for about 20 minutes. If you plan to exercise, then you can ice the area after physical activity. You never want to apply ice to a muscle that has never been exercised or worked before; you only want to apply ice straight to acutely inflamed or swollen joint or area.