Effect of heat and cold for pain relief

The usage of heat and cold as an aid for pain management and for stress reduction has been well known for centuries. The health benefits of hot springs in contrast to dipping in icy waters – both methods used as an effective way to dampen pain.
The question that arises is when is each of these appropriate? First, one must understand what the source of the pain is, whether it's a new pain or pain that has been ongoing for over 3-4 days.
Pain is a bodily indication that something is wrong.  Pain is one of the signs of inflammation and an indication of tissue damage. 

New Pain
New pain can arise from physical trauma: fracture, overstretching, sprains or strains and can arise due to overuse from inappropriate physical exercise or movement such as lifting heavy loads or making sudden movements. In both cases, the body creates inflammation:  white blood cells rapidly flood the bloodstream, aiming to correct damage caused to bodily tissues. But the amount of blood that rushes to the area is excessive.  Cooling pillows (a specially designed pillow placed in the freezer for 30 minutes) may be extremely helpful during this phase. The cold helps slow down blood seepage that causes swelling, slows down nerve impulses and metabolic processes, thereby reducing the need for oxygen, but on the other hand increasing the tissue healing rate.
In the initial phases of pain, the affected area must be cooled a number of times daily, every hour for 10 minutes
There are various ways to cool the affected area including frozen corn packs, ice packs and more. However, the most convenient way is by using a convenient cooling pillow.
Ongoing pain
Discomfort that has been present for over 48 hours can be treated by using a heating pillow. This will help expand the blood vessels to enable fluid to escape from the injured area back to the blood stream. The usage of heat is recommended to help ease p ongoing pain, by promoting muscle and soft tissue relaxation. Heat helps ease pain by reducing nerve irritation. This in turn, further promotes muscle relaxation. 
In some cases, it may be best to alternate between a heating pillow and a cold pillow in order to create better circulation to the affected area. Heating aids can include saunas, hot tubs or simply placing a heating pillow on the affected area a number of times daily.