How to select faces while using texture painting in 2.8?
I guess you have this issue on Blender 2.8 because you're using the default Left click select keymap?

First things first:

In order to enable the face selection masking, push down that little button in the viewport header:



Then, in order to select the faces you want to paint on, use the &#9095; Alt LMB. You can also access some selection tools, like Border Select with B, or Circle Select with C.

For more advanced control of selection, you can switch to edit mode, do what you need and switch back to paint mode.