Cramp occurs when a muscle suddenly contracts, causing pain. It’s more likely if you’ve been exercising for a long time or are dehydrated.
If it starts, stop moving and try to gently stretch out the muscle. If it really hurts you can try clenching your fists! By tensing a muscle elsewhere in the body, it seems to relax the one that’s cramped.