Molecular weight of NaOH = $1\times23+1\times16+1\times1$ = 40 grams
Molarity = $\large\frac{mass}{molar mass} \times \large\frac{1}{1000}$
For 250 ml of solution
Molarity =$ \large\frac{mass}{molar mass} \times \large\frac{250}{1000}$
Molarity = $ \large\frac {mass}{molar mass} \times 4 $
$\therefore Mass = \large\frac{molarity \times molar mass}{4}$
$\therefore Mass = \large\frac{0.1 \times 40} {4}$
$\therefore$Mass = 0.1 gram
Hence 1 gram of NaOH is required to prepare 0.1M solution.