If you expect to install a shelf and have it support a decent amount of weight, you will have to install some heavy duty shelf brackets in order to do so. Having insufficiently strong brackets is a bad idea. Having a shelf collapse can be dangerous, in addition to damaging your wall and shelf. While drywall is far from the strongest building material, it is still possible to install strong shelving brackets in it if you know what you're doing and plan ahead appropriately. What follows should give you everything you need to know to do it.
Step 1 - Planning and Measuring
While drywall is not reliable enough to support the weight of a shelf under normal circumstances, there are plenty of ways to make this particular project work. One way is by attaching the brackets to a wall stud, rather than the drywall. Any stud detector that you buy will do the job adequately, so aim for something cheap if you don't already have one.
Once you've located one or more studs, plan out your shelf. Use a level to find the angle that is exactly parallel to the ground, and mark it lightly on your wall in pencil. Use one of your brackets as a model and mark the wall where brackets will have to go. Use the wall studs if at all possible.
If you can't use any wall studs for some reason, that's fine. Measure and mark your wall in the same way.
Step 2 - Using Drywall Anchors
While wall studs are the best place for brackets, it is not always possible to put every required bracket on a wall stud. For brackets that must be placed on drywall, you can use drywall anchors to strengthen and support them.
Get out a drill, either hand powered or electric. Place your shelf bracket and use the drill to install the drywall anchors in the marked location from your plans. You will need a screwdriver head attachment to do this. Be sure that you don't tighten the drywall anchors all the way, though you should get them fairly tight. If you tighten the drywall anchors completely, you will not be able to adjust the bracket if something goes wrong.
Step 3 - Making Adjustments
Check the current location of all of your brackets as compared to the measurements you have planned out. If all is well, continue. If something is wrong, make sure it's perfect before you go on.
Step 4 - Finishing
While holding the bracket in place, use your screwdriver or drill to install the heavy duty shelf brackets that you planned to put over wall studs using screws. Make sure they are aligned properly as you planned in your measurements, and then install screws into the drywall anchors that you used previously, tightening them all the way to make them permanent.