As a general rule of thumb, use ice for acute injuries or pain, and heat for muscle pain.
Treating pain with cold, referred to as cryotherapy, is an easy and effective way to reduce inflammation and relieve nerve damage.
Be careful though:
Cold therapy applied for too long or too directly can result in skin, tissue, or nerve damage.