How i can avoid specific parts of the mesh to be sculpted

i already tried to use mask and box mask and it does not work
is there any other alternative i can use?

what do you mean… it works! You mask the part you don’t want to sculpt (turns dark) and then you sculpt at will

Mask brush is a brush with a strength slider set at 0.5 by default.

That means that by using it by making only one stroke on an area will not fix vertices of that parts but just minimize effects of other brush.
You need to make several strokes or set strength to 1 before using the brush.

Box Mask should produce a mask at maximum values. It should work except if you stopped to drag mouse or release mouse button before including mesh into drawn rectangle.

If you are really encountering a bug and mask don’t work, you can try to hide parts of mesh instead.