“The evidence is fairly mixed on magnesium, and it’ll differ on a case-by-case basis. If you’re struggling to sleep and you’ve not made any lifestyle changes before taking magnesium, i.e, reducing smoking, drinking, sugary drinks, etc., then do this before becoming reliant on magnesium.”
Article source: https://www.huffingtonpost.co.uk/entry/common-sleep-questions-answered_uk_69d77b11e4b0ccb589eb1684