Determine the approximate location where you want to hang your shelf and check for studs. While you can use an electronic stud finder, you may also test for studs by knocking on the wall and listening for when the noise sounds more solid than hollow.
Screw one of the mounting brackets into the wall on a stud. Find the next stud over and mark it with a pencil.
Lay one end of the shelf on the mounted bracket. Hold the other mounting bracket against the wall so that the other end of the shelf rests on it. Set the level on top of the shelf and move the second bracket vertically until the shelf is level. Screw the mounting bracket in place into the wall, then rest the shelf on the brackets.