Just look at properties of both and see whats different ....
Dont know exact answer, but its two solids (i think), so maybe sieving, if particle size varies, umm i think the sodium would be soluble but magnesium hydroxide would not ( or maybe slightly soluble) and then use filtration. Maybe you have to treat the hydroxide with an acid?
Im not sure, just showing you the procedure if you dont find answer