Drink enough water throughout the day, especially after physical activity.
Hydrate
Stretch your calves and hamstrings before bed and during the day
Stretch
Do leg exercises during the day and some light exercise, like walking or biking, before bed.
Exercise
Choose shoes that support your feet and have the right arch and ankle support.
Wear supportive shoes
Try different sleeping positions, and keep your toes up if you sleep on your back or hang your feet over the edge of the bed if you sleep on your front.
Sleep position
Keep the sheets and blankets loose around your feet so you can move around more easily.
Keep covers loose
A warm bath or shower can help soothe tight muscles before bed.
Take a bath