Those painful muscle cramps that awaken you at night will often be alleviated by magnesium (Mg).
If you aren’t getting an absorbable form of magnesium----Mg citrate or Mg glycinate are good--- in your supplement regimen, and there are no contraindications, consider trying it.
The target dose is 400 mg / day, and it’s best to start with 100 mg / day, gradually increasing to the target level. Slowly building to the target dose will help avoid diarrhea.