Pencil not showing up

When I pressed “b” to change back to the pencil tool it was only showing the eraser, why?

Are you using a stylus? Some pens have a button to switching between the eraser tip and the regular tip. If that is not the case, check if you have the mask/transparent color selected as foreground color, if that is the case the pencil will act like the eraser tool.