(Getty Images)

Cramps are terrible. Even the word is displeasing — it’s dismal and clunky — so it’s kind of a perfect descriptor for when your muscles tighten but don’t have enough fuel or spirit to relax back to their original happy state. The good news is that most of us who aren’t training for endurance runs or Olympic rowing competitions can generally keep our systems in working order with a consistent supply of water and electrolytes.

Cramps fall into two camps, says Mark Lavallee, chair of the Sports Medicine Society for USA Weightlifting. The first is metabolic: You’re cramping up because of dehydration or an electrolyte deficiency, where your muscles are happy to contract but don’t have enough fluid to relax. The second is more mechanical, such as if you’ve never run in your life but decide to go for a nice morning five-miler. Both are awful. Here’s how to avoid — or at least minimize — the awful.

Before you cramp

Audit your water levels. Lavallee has a few ways to evaluate your hydration level: If the mucus in your nose or mouth is tacky and thick, if your saliva is sticky, or if you’re urinating a dark shade of yellow, your tank is low. (You want a faint yellow.) Drink up.

Check your electrolytes. This is easy and hard. “Every day in this country, some new voodoo guru supplement comes out,” says Keenan Robinson, most well known for being Michael Phelps’s strength coach and sports medicine provider. “We need vitamin B, sodium, potassium and calcium. That’s been proven since Galileo was opening up medical books,” he says. But every person’s system is different, so you may need a few weeks of trial and error to establish how much (or whether) you’ll need to pre-load with a sports drink, gels or salt tablets (not coffee — that’s a diuretic). Brazenly, Lavallee also suggests something “really old-fashioned called food.” OJ and bananas, people — you know the drill.

Massage yourself. Robinson’s also big on such simple self-care tools as foam rollers and stretch bands. “We think of muscles as one huge group, but there are little micro-spindles that make up fibers,” he says. “Some might be already cramping, but you don’t feel it because it’s on a microscopic level.” A little attention will help loosen them up. He’s also a fan of compression garments, which enclose the muscle and limit the opportunity for it to react and spasm quickly.

During workouts, hydrate every 15 minutes. Henrik Rummel of the U.S. Olympic rowing team makes a simple habit of swigging from his water bottle and popping occasional electrolyte tablets during his team’s brutal two-a-days. “We sweat a lot, but we put a lot of liquid back,” he says. Connor Jaeger, who won silver in the 1,500 freestyle at Rio and will swim in the Olympic trials this summer, mixes a cocktail of water, Gatorlytes electrolyte powder and a salt tablet to keep him going during his four hours of daily practice. Whatever you’re sipping, take in seven to 10 ounces in those intervals.

Use your brain. “It’s like any preparation or any kind of work — if you get behind it, you have to do a lot more to catch up,” Rummel says. “If you stay on top, it’s not that bad.”

After you cramp

Ugh, sorry. Been there.

Hydrate again. Get some water, a sports drink or a high-sodium drink mix in there; it takes about seven minutes for your stomach to absorb it. If you’re not into sports drinks, which can be high in sugar and calories, drop some electrolyte tablets or powder into your water bottle, or sample coconut water. Years ago, trainers got into pickle juice, which is high in sodium and vinegar. Lavallee says it’s not nutritionally any more beneficial than water or Ga­tor­ade, but it is a conversation starter.

Breathe. Cramping is tension, so you need to relax. Emiliano Tramontozzi, fitness manager of a Crunch gym in New York City, starts by breathing it out. “Not the fight-or-flight breathing through the chest,” he says. “Concentrate on diaphragmatic breathing, in through the nose, out through the nose.” Yes, this means you may have to take a break, but Tramontozzi says that’ll help “let the muscle ease out of whatever flexion it’s in.”

Do some light stretching. Don’t automatically stretch the cramping muscle. Take the load off it. For calves and hamstrings, Lavallee says, sit on the ground and stretch your legs out in front of you. Keep them straight, grab your toes and pull back, which will force the leg to straighten out. Robinson suggests trying ice first, but if you can walk off the court or course, soaking your feet in a hot tub would also help. If it’s happening all the time, maybe pull back on the workouts.