Stretch the affected muscle. This is the most important thing you can do to relieve a muscle cramp. Stretch the muscle in the direction opposite of the cramp. For example, if you have a cramp in your calf, stretch your leg by pointing your toes towards the ceiling.
Massage the affected muscle. This can help to relax the muscle and reduce the pain.
Apply heat or cold to the affected muscle. Heat can help to relax the muscle and reduce pain, while cold can help to reduce inflammation.
Drink plenty of fluids. Dehydration can contribute to muscle cramps, so it's important to stay hydrated.
Take a rest. Don't try to continue exercising with a muscle cramp. Rest the muscle and allow it to recover.
Get electrolytes. Electrolytes are minerals that help to regulate muscle function. If you're low on electrolytes, you may be more likely to experience muscle cramps. You can get electrolytes from sports drinks, fruits, and vegetables.
See a doctor. If you have frequent or severe muscle cramps, see a doctor to rule out any underlying medical conditions.