Visibility, Masking & Face Sets
Parts of the mesh can be hidden in Sculpt Mode. Because hidden faces cannot be sculpted, hiding makes it easier to isolate what you want to work on. Hiding geometry also improves the viewport performance.
Hiding is shared between all modes, except Object Mode (i.e. hiding/showing of faces in one mode will hide the same faces in other modes too).
Unlike Selection Masking in other painting modes, Sculpt Mode primarily uses Masks and Face Sets to easily control the mesh visibility and which faces can currently be edited. The exception is the Clipping Region, which can be used in any mode.
The most common shortcuts are H to isolate the face set under the cursor (or show everything) and Shift-H to hide the face set under the cursor.
Inverting the visibility and showing all is also available in the W pie menu.
More information for controlling the visibility at Show & Hide.
A mask is used to control which vertices of the mesh are influenced by sculpting and painting. The mask can for example be created/edited via the Mask Brush, Box Mask, Lasso Mask, Line Mask and Mask by Color tools.
Clear & Invert
Creating masks follows a slightly different mental model than selecting in other modes. For example Shift-LMB is used for smoothing instead of adding to a mask.
Masking is also conceptually inverted to selection (i.e. You cannot edit masked vertices. But you can edit selected vertices).
Instead a mask is typically always added to the current mask with LMB and subtracted with Ctrl-LMB. So if you wish to edit the masked surfaces, you'll need to use the Invert operator, In the case of masking everything that is visible, the best workflow is to first Clear and then Invert the mask.
Both these operators can be quickly accessed in the A pie menu.
More information about editing and using masks at the Mask Menu
Face Sets are used to group your mesh into differently colored faces, which can then be quickly hidden or shown like mentioned above. They can also be used for fast mask creation via the Mask Expand. Face Set Expand is also useful for creating, editing and joining face sets.
More options can be found in the W pie menu.
Otherwise Face Sets can be created/edited with the Draw Face Sets brush, Box Face Set and Lasso Face Set. They can also be edited with the Edit Face Set tool.
More information about editing and using face sets at the Face Sets Menu
Auto-Masking is also a fast way of only editing specific geometry without having to manually create a new mask or hide geometry. This feature is especially useful in combination with face sets.
The mask and face sets display can be toggled and adjusted in the Display Settings.
When Xray shading is enabled, masks and face sets will not be displayed.