Mg + H2SO4 > MgSO4 + H2
The left over magnesium is filtered off and the mixture boiled down slowly to concentrate.
When it is cooled, crystals will form, these can be blotted dry with a piece of paper.
This can be done with other metals and acids:
Nitric, sulphuric and hydrochloric acids make soluble salts with most metals.
ammonium, potassium and sodium make soluble salts with acids