The Eraser tool changes pixels to either the background color or to transparent. If you're workingon a background or in a layerwith Transparency locked, the pixels change to the background color. Otherwise, the pixels change to transparent.
You can also use the Eraser to return the affected area to a previous state by selecting that state in the History panel.
Start by selection the Eraser tool. If you're erasing the background or a layer with locked transparency, set the background color you want to apply.
First, switch background and foreground colors.
Then, in the Options bar, choose a Mode setting. Brush mode and Pencil mode set the eraser to act like a tradional brush or pencil, respectively. Block mode gives you a hard-edged fixed-sized square.
For Brush or Pencil modes, choose a brush preset, and set the Opacity and Flow in the Options bar. (Block mode does not have Opacity and Flow options.) An opacity of 100% erases pixels completely. A lower opacity erases pixels partially. See more about these tool options.
To erase to saved state or a snapshot of the image, click the left column of the state or snapshot in the History panel and then select Erase To History in the Options bar.