calculate the mass of solute of the following volume.......24cm3 of 4gmol/dm3 of NaOH

I don't know what 4 gmol/dm3 means. You may have 4 g/dm3 or 4 mols/dm3 but I don't know you have have 4 gmol/dm3.

1 dm3 = 1 L = 1,000 cc.

If you mean 4 g/dm3 that is 4g/L = 4 g/1000 cc so
24 cc x 4 g/1000 cc = ? g

If you mean 4 mol/dm3 that is 4 mol/L = 4 mol/1000 cc so
24 cc x 4 mol/1000 cc = ? mol NaOH Then mols NaOH x 40 g NaOH/mol NaOH = ? grams NaOH/24 cc.