There are several ways to lock the contents of a Photoshop PSD file. Locking refers to protecting certain elements of a composition from editing, usually a layer or layer group. Generally the primary reason to lock elements of your composition is to protect them from unintended changes while you edit something else within the composition.
Layers and Layer Groups
Layers and layer groups are what you'll be locking in most instances. There are several options to control how a layer is locked. To totally protect the layer from any editing, fully locking the layer is the best option. Otherwise, you can lock the transparency, image pixels and/or the layer's position.
Select the desired layers or layer groups from the Layers palette.
Click the Lock all button from the Lock options on the layers tab to fully lock the layer and prevent any edits.
Click the Lock transparent pixels button to lock all transparent pixels, preventing edits to pixels with less than 100 percent opacity.
Click the Lock image pixels button to lock only the pixels and prevent edits when using painting tools.
Click the Lock position button to prevent all pixels on the selected layer from being moved.
Photoshop's Slice tool can also lock a composition with slices. The Slice tool divides the image or composition into smaller sections or "slices," which you can then edit individually. Unlike layers, individual slices or their properties can't be locked: choosing the Slice Lock option fully locks all slices.
To lock slices, click View followed by Lock Slices. Select this option again at any time to unlock your slices.