Convert grams to moles using molar mass.
Converting a weighed mass to moles is a single division by molar mass, but doing it honestly means accounting for purity. A reagent bottle labelled 99.5% contains half a percent of something else — usually water, or the salt of a different hydration state — so 25 g of it holds only 24.875 g of the substance you intend to react. On a small scale that shortfall is negligible; in a stoichiometric synthesis or a titration standard it is the difference between a clean result and a systematic error you will never find by repeating the measurement. This reports both the corrected amount and the moles the impurity costs you, so you can judge whether to compensate.
Purity-corrected grams to moles
Pure mass = weighed mass x purity / 100; moles = pure mass / molar mass; millimoles = moles x 1000
Whichever matches the bottle. Copper sulfate pentahydrate is 249.68 g/mol, not the 159.61 g/mol of the anhydrous salt, and using the wrong one introduces a 56% error in the amount you think you have.
Whenever the reagent is the limiting one, when preparing a primary standard, or when yields are being reported. For a solvent or a large excess it can normally be ignored.
Because bench chemistry usually works in the 0.1-100 mmol range, where millimoles avoid strings of leading zeros and make the arithmetic of a reaction easier to follow.