If your brush suddenly becomes an eraser for no reason and you do not understand why. Here is the fix. On the top menu on the left, change the MODE selection to Normal and your brush is back to normal. If you want it becomes an eraser brush change Mode to CLEAR.
The Eraser can be a brush, pencil or block with the characteristics available to each. For example if brush is selected, the eraser's size, hardness, opacity, flow and smoothing can be adjusted as you would with a normal paint brush. Ditto for pencil. See screenshot from PS CC 20.
Nancy O'Shea, Adobe Product User & Community Professional Alt-Web Design & Publishing ~ Web : Print : Graphics : Media