I have jerking in my legs and my feet try to draw together especially at night

Do you have any idea what causes this and what I can do to help prevent this. Very annoying…