When I get muscle cramps, I usually stretch the area gently, massage it, and drink water or something with electrolytes. To prevent them, I stay hydrated, eat potassium-rich foods like bananas, and warm up before exercising.