Land Masking Values to NaN

Hello, so I am working with IdePix for an S2a image. I already created the land mask, however, I am trying to make those values in particularly to NaN. I am trying to mask out the land. Any help in achieving those pixel values to NaN?

if you already created a mask (let’s say its name is ‘landmask’) you open the layer properties of each of your Sentinel-2 bands and enter a valid pixel expression: landmask < 1
This will make them NaN in your SNAP project.