When you use masks to hide and reveal parts of the layers in an Adobe Photoshop document, you can edit your masks using some of the same tools and options you rely on to alter and retouch Photoshop ...
If Photoshop keeps crashing while you're editing with a lot of layers, you may benefit from merging some of them. Learn how to merge layers and flatten your image with this how-to.