It may help to think of a mask as a stencil. You've probably used a stencil before. Shapes or words are cut in a piece of paper or plastic. Slap on some paint from a brush or a spray can. Remove the stencil and your picture or words are perfectly painted -- no unintentional crooked lines or bits of paint in places it doesn't belong. (OK, in reality it seldom works so well unless you are very, very careful.)
In your graphics program a mask works exactly the same. It covers parts you don't want to change and leaves holes where you do want to make changes (change colors, apply filters, etc.).
In the image here, you'll see the difference a mask can make. In the example on top painting across the egg puts a streak across the egg and background. In the example on the bottom, with the background masked (covered) the paint only sticks to the uncovered egg.
You'll need to look at the tools and menu choices in your own software, but chances are it has several different ways to create masks. You may see a collection of selection tools that look like a square, a circle, a paintbrush, a lasso, and a magic wand. These tools let you mark parts of your image (select them) but also act as a mask. Only the parts of the image selected with the mask tool can be changed.
Another option is to use another image as a mask. For example, you may use a black and white checkerboard image as a mask. Place it (using the appropriate options in your software) on top of another picture. The black squares of the checkerboard protect the underlying image. The white squares of the checkerboard are like the cut-outs on your stencil.
When you load an image to use as a mask you may not see the actual image on top of your existing graphic. A dotted marquee line may appear outlining the masked/unmasked portions. If you don't see the marquee, look for a menu option or command that makes the mask visible (you may even be able to select the color of your mask, depending on your software).


