Prevention of Muscle Cramps Measures to prevent cramps include the following: Not exercising immediately after eating Gently stretching the muscles before exercising or going to bed Drinking plenty of fluids (particularly beverages that contain potassium) after exercise Not consuming stimulants (eg, caffeine, nicotine, ephedrine, pseudoephedrine) Not smoking The runner's stretch is most useful.