You solve this by realizing

moles = (grams)/(grams/mole)

The grams/mole value of a substance is its molecular weight. That is found by adding the atomic weights of the constituent atoms. The atomic weights are ...

Na: 22.9898

O: 15.9994

H: 1.0079.

There is one atom of each in NaOH, so the molecular weight is the sum of these numbers: 39.9971.

moles = (25 g)/(39.9971 g/mol) = .625 moles.

moles = (grams)/(grams/mole)

The grams/mole value of a substance is its molecular weight. That is found by adding the atomic weights of the constituent atoms. The atomic weights are ...

Na: 22.9898

O: 15.9994

H: 1.0079.

There is one atom of each in NaOH, so the molecular weight is the sum of these numbers: 39.9971.

moles = (25 g)/(39.9971 g/mol) = .625 moles.