A layer mask in digital image editing is a grayscale image that is used to control the visibility of an underlying layer. By painting black on the layer mask, you can hide the corresponding areas of the underlying layer, and by painting white, you can reveal them. Layer masks are a powerful tool for creating complex selections and for making non-destructive edits to your images.
To toggle a layer mask on and off, simply click on the layer mask icon in the Layers panel. When the layer mask is turned on, you will see a white border around the layer mask thumbnail. When the layer mask is turned off, the border will be gray.