Remove all of the items from the top shelf and the shelf directly below the top shelf.
Place an angle bracket at the end of the top shelf so one end of the bracket rests on the shelf and the other end rests against the wall.
Mark the mounting holes on the shelf and the wall with a pencil and then place the brackets off to the side.
Drill a hole through the marked locations on the wall with a drill bit large enough to fit the wall anchor you plan to use. Drill a hole through the marked locations on the shelf with a drill bit large enough to snugly fit the bolts you plan to use to secure the shelf to the brackets.
Drive the anchors into the wall with a hammer and then place the brackets back onto the shelf and against the wall. Line the holes up in the bracket with the holes on the shelf and the wall.
Place a washer onto the first bolt you plan to install into the wall anchor, and then secure the bracket to the wall with the bolt and a screwdriver or wrench. Repeat the process with the second bracket.
Place a washer onto the first bolt you plan to use to secure the shelf to the bracket. Push the bolt through the bracket and then through the shelf. Place a washer onto the end of the bolt and then secure the bolt with a nut and wrench.
Sweep off any dirt or dust from the shelves with a dust broom.