Magnesium is an essential chemical element for the proper functioning of the body, as it is involved in many vital…