Divide the mass of hydrated water (moles or mass, depending on the intent) by the mass of the entire compound.
A hydrated compound is usually indicated by a numerical prefix (Greek) in the name, or the written number in the formula. Hydrates are complete water molecules associated with a salt, so they are always indicated as a unit in the formula.
For example, copper (II) sulfate pentahydrate is the copper sulfate molecule with five (penta) water molecules. The formula is