Ice and heat therapy have long been used as a means of treating acute and chronic muscular and joint conditions.
Ice is used in acute injuries for the first 72 hours or longer when swelling is a problem.
In chronic conditions such as overuse injuries, ice helps with the inflammation and swelling.
Note for athletes or injuries due to activity or gym: ice should only be used after an activity not before as it can hinder performance if used for more than 10 minutes 
Ice is placed onto the injured area for 15-20 minutes
Ice therapy can be done using a bag filled with ice cubes, a gel ice pack, or a packet of frozen peas.
Heat therapy is mainly used to help relax muscles and relieve aching joints.
Note for athletes or injuries due to activity or gym: Heat should not be used after activity or after an acute injury especially when there is swelling
Heat is placed on the area for 15-20 minutes or longer if desired.
Heat therapy can be done by using an electric heat pad, hot water bottle, wheat bags or a hot bath or shower.
The two can also be used alternately, that is 15 minutes of ice followed by 15 minutes of heat for chronic condition. If you are still in doubt, ask your chiropractor which one they suggest for your condition.
 Saam F, Leidinger B, Tibesku CO (March 2008). “[The influence of cryotherapy of the ankle on static balance]”. Sportverletzung Sportschaden. 22 (1): 45–51. doi:10.1055/s-2007-963601. PMID 18350484.