How many formula units of the compound are present in 5.7g of Epson salt?

find the formula for Epsom salts and add up the atomic weights. That is the molecular weight per unit.

Divide 5.7 by that number. That gives the number of moles.

Multiply the moles by Avogadro's number to get the number of molecules (or formula units).