Mark the area on the wall where you want to install the molly anchor with a pencil. The shelving may require two or more anchor points, depending on how long the shelf is.
Drill a pilot hole the size of the molly bolt. If the molly bolt is 3/8-inch per its packaging, then use a 3/8-inch drill bit.
Tap the sleeve of the molly, the anchor portion, into the hole with a hammer until the edge of the molly is flush against the wall. Be careful not to pound too hard to avoid damaging the drywall.
Use a screwdriver to install the screw into the sleeve until you feel strong resistance or it is the appropriate length. Leave the screw sticking out enough that you can mount the object you are hanging. To hang a picture, for instance, you may want to leave the screw extended longer than you would if hanging a shelf.