Proper hydration is one of the best ways to prevent muscle cramps during activity. Also potassium is important in preventing cramps, as mentioned above eating bananas is a great source of potassium. If you are staying hydrated, stretching properly, and eating healthy but still getting cramps you may need to take a potassium supplement.
One of the most common and overlooked causes of muscle cramps is actually dehydration. (It is funny that lack of water seems to be the culprit in several health issues.) Of course, once you are thirsty they say it is too late. In addition to the above suggestions, another way to prevent muscle cramps is to fully hydrate before, during, and after exercise.
Many athletes and trainers will also tell you to keep your muscles warm, both by stretching and warming up, but also by dressing properly for the environment you are training in. So if you are a winter jogger, wearing warm enough clothes that your muscles aren't shocked at the temperature will help to prevent cramping. Getting proper rest before exercising is also important, as tired muscles are more prone to injury, and the older you are, the more important these precautions become.
The first thing to do if you are cramping is to stretch the cramp out. That's sort of like first aid for the cramp. As for eating, most people would say that you can prevent cramping by staying well hydrated. They also say that you can prevent it by ingesting potassium. That's why people talk about eating bananas to prevent cramping.
Muscle cramps can be prevented by gentle and slow stretching movements, before and after any demanding physical activity.
To oxygenate and relax the muscles, breathe slowly and prolonged while stretching your muscles. As food, the consumption of proteins and carbohydrates must be increased.
If you drink natural cherry juice, after physical exercises, it could be beneficial for you, because cherries are rich in antioxidants.