Layer Masks rough guide
(I'm using Photoshop CS2 here, but the same should apply to other versions)
Here I have 2 layers, a background layer filled with red, and a photo of an eye above it.
To apply the layer mask click the icon at the bottom of the layer palette and a mask icon will appear next to the layers thumbnail. (The mask is currently selected denoted by the highlight around the thumbnail).
By default the mask will be applied filled with white. As white in the mask reveals the contents of the layer, all of the eye layer is visible. To hide parts of the layer you need to paint a value other than white (black will completely hide). So here (with the mask selected) I use the fill tool and fill the mask with Black fully revealing the red base layer below. You could use a brush and paint out areas if you wanted, I'm using the fill for demonstration purposes.
Now I can paint back white into the mask to reveal the hidden eye photo again. I'm using a custom brush here to show that you aren't restricted to a solid black or white and can achieve some interesting textures.
Another option you can use is to disconnect the link between the mask and the contents of the layer. This means the layer mask will remain where it is and still affect the same area of the canvas, but I can manipulate the photo layer independently. This is done by clicking on the links icon between the 2 thumbnails (it can be reversed at any time by clicking the space again.
I can take the move tool (V) and pan the photo around while the layer mask stays put.
If I reattach the link and move the layer again, the mask follows along with it (note this photo was larger than the canvas size to begin with so the edge of the mask (which is the same size as the canvas), is now seen.
You can delete the mask at any time the same as you do with a layer and Photoshop will ask you if you want to keep or discard the effect of the mask. You can also view the mask properly by ALT clicking on the mask thumbnail and paint into it directly while it's visible (ALT clicking on the mask thumbnail or the image thumbnail will return you to the canvas view).
(I've run out of attachments to show that, but it's basically displaying the black and white mask as it would an ordinary layer)