Stretching and flexingStretch out tight muscles before bedtime
A good stretch session helps the leg muscles to relax before bed. If you exercise or play sports, you will probably be familiar with the stretches that help you the most. If not, it is a matter of experimenting until you find the stretches that are right for you. There are plenty of step by step examples on the internet, including videos on YouTube.
Here are couple of sites to start you off:
Some people find moving their legs before bed helps, like going for a quick walk. If my legs are feeling really uncomfortable, I find calf raises help (I have no idea why!) and I usually do about 20, using both legs at the same time.