The creation of a layer mask requires two things: an open document and any Photoshop layer type with the exception of the Background. When you add the layer mask, you will be working with two layer elementsthe image and the mask. It's important to know what element you're working on, or you might wind up painting on the image instead of the mask. When that occurs, it's good to remember the undo button. Once the mask is created, you can selectively control, without erasing, the visible portions of the image.
Layers palette.
Add Layer Mask button.
The active pointer resembles a paintbrush, indicating you are working on the image.
The active pointer resembles the mask button, indicating you are working on the mask.
chain button to separate the mask from the image.
This allows you to move the mask, without moving the image, or vise versa.
chain button again to reestablish the link between mask and image.