From the NHS website:
"Regular calf-stretching exercises might not completely prevent cramps, but may help to reduce them.
How to stretch calf muscles:
Stand facing a wall, arm's length away, with your feet flat on the floor.
Lean forward, pressing your hands against the wall until you feel your calf muscles stretch. Hold for 2 or 3 seconds.
Stand up straight again.
Repeat a few times for 5 minutes, 3 times a day (the last time just before bed).
If the number of cramps reduces, you might only need to do the exercise once or twice a day".