Restless Legs

Help! How do you make restless legs stop? I can be SO TIRED but as soon as im almost asleep my legs want to kick. And then it keeps me awake. Any tips to make it stop? This usually only happens when im pregnant.