Bookcases are a good way to keep clutter off the floor or tables. You can use them not only for books, but also for knick-knacks, trophies, collectibles and other things. If you have a lot of things on the shelf, it can get a bit heavy and might become unstable. The higher the bookcase or the more items that are on it, the more likely that it could tilt. It is best to anchor the bookcase to the wall to keep it steady.
Place the small L bracket where you want to attach it. Typically you want to select a place the isn't too noticeable such as the top of the bookcase. Mounting a bookcase to the wall doesn't mean you have to secure it all the way down to the floor. They don't move that easily. What you want to ensure is that it doesn't topple over. Securing it to the wall near the top will accomplish this.
Mark the screw holes of the bracket where it meets the bookcase and wall.
Remove the bracket and drill pilot holes. The holes need to be smaller in diameter than the screws that come with the bracket. If the brackets is being connected on top of the case, use a bracket that is small enough for the screw holes to be on the edge of the back board, not through the top. If they are placed on the side they need to line up with the side edge of the backboard, not the side panels. This way the screws won't go through and be visible from inside the case.
Place the bracket back in place over the pilot holes and drill screws in. Use 1.5-inch screws for the bookcase and 2- or 3-inch screws for the wall. If when drilling into the wall you didn't hit a stud, tap sturdy drywall anchors into the pilot hole before attaching the brackets.