First, you need to calculate the number of moles of NaOH.
\(moles=mass/molecular\space mass\)
Na has an atomic mass of 23, O has an atomic mass of 16, and H has an atomic mass of 1. The molecular mass will be the sum of these atomic masses.
\(moles=34/(23+16+1)\)
\(moles=0.85mol\)
Each mole is 6.02*10^23 molecules, so to find the number of molecules, we multiply this number by the number of moles.
\(molecules=0.85\times6.02\times10^{23}\)
\(molecules=5.12\times10^{23}\)
There are therefore 512,000,000,000,000,000,000,000 molecules in just 34g of sodium hydroxide.