A mask hides parts of a layer without changing it. Add one in Layer (Add mask, or Mask from selection), or just use the Eraser on a layer.
While Edit mask is on (or the mask button on the layer’s row in Layers is lit), the Eraser hides and the Brush brings back. Soft brushes make soft edges.
Give an adjustment layer a mask to change only part of the photo: add Light & color, use Mask from selection, or erase where it should not apply.
Invert swaps what shows and what hides. The eye next to Mask turns it off to see the whole layer again. Delete removes the mask, and the layer shows in full.