Hold the shelf in the position that you want to install it. Lay a carpenter's level on the shelf as you position it to ensure it is level after installation. Mark the location on the wall of the screw holes in the supporting brackets using a pencil. Set the shelf aside.
Drill pilot holes into the wall at the pencil marks. The size of the holes can vary with the manufacturer, but most toggle bolts use a 1 1/4-inch drill bit for a 1/2-inch toggle and a 7/8-inch drill bit for a 3/8-inch toggle. Do not use a toggle smaller than 3/8-inch in diameter, as it may not support the weight of a shelf.
Insert the machine screw into the hole in the supporting shelf bracket. Screw the toggle onto the machine screw oriented so that when you bend its wings, they point toward the head of the machine screw and lay parallel with the screw. Repeat with the remaining toggles and machine screws in the supporting shelf brackets.
Hold the shelf in position on the wall. Insert the end of the machine screws into the holes until the toggle wings temporarily halt their progress. Press the wings together so they are parallel with the screw and push the entire machine screw, toggle and all, into the hole as far as it will go. Repeat with the remaining toggles and machine screws.
Tighten the machine screws with a screwdriver, but do not over-tighten them. As you turn the screws, the toggle wings dig into the back of the wall, holding them tight and secure against it. The weight of the shelf is spread out over all of the toggles, so it will not pull out of the wall because of its weight.