Locate a stud in your wall using a stud finder.
Set up the bookshelf so that its back is set flush up against the wall where the stud is.
Place an L-bracket snug to the wall on the top of the bookshelf. One leg of the "L" is against the wall facing up, the other is on the bookshelf.
Screw two screws into the L-bracket to hold the bracket to the wall using an electric drill. The screws you use to attach the bracket to the wall should be at least 2 inches long. Make sure that you place the screws so that they attach to the stud behind the wall.
Screw two screws into the lower leg of the L-bracket to connect the bracket to the bookshelf. These screws can be shorter, as 2-inch screws would extend into the display area of the bookshelf.