To calculate molar mass, go to the periodic table and find the masses of each atom present in sodium hydroxide.
There's one oxygen, one hydrogen, and one sodium.
The mass of sodium is: 22.99
The mass of oxygen is: 16.00
The mass of hydrogen is: 1.01
add them together and you have your molar mass
1(22.99) + 1(16.00) + 1(1.01)= 40.0 g/mol