Preventing Leg Cramps. 1  1. Drink plenty of fluids every day to reduce the risk of cramps from dehydration. 2  2. Wear shoes that have cushioned foot beds and arch supports. 3  3. Use a pillow to prop your knees up while lying in bed.  4. Sleep under looser 1  sheets. 5. Stretch, walk or use a stationary bicycle for 5 minutes before going to  bed.