The best way to install a shelf depends on the type of shelf and the type of wall. In general, the steps for installing a shelf include:
Finding the wall studs or using appropriate wall anchors. Installing shelf brackets at the correct height and spacing. Placing the shelf on top of the brackets and securing it with screws or adhesive. Checking the level and making any necessary adjustments.