"Just take magnesium"
In two studies on men who train, a popular magnesium and zinc supplement didn't change their sleep. Not even after two nights with too little sleep.
Keep in mind: they were healthy and ate well. If you're low, it could be a different story.