A shelf is only as strong as its fixing. Find the studs with a stud finder, and mark where the shelf will sit using a level so it doesn't slope.
Screw brackets into studs when you can. If a stud isn't in the right place, use anchors rated well above the weight you plan to load, such as toggle bolts or heavy-duty drywall anchors, and drill a pilot hole first.
Spread heavy items across more than one bracket and never load a shelf beyond the rated limit of its brackets. Recheck the screws after a few weeks.
Next in Home Improvement: Fix a dripping faucet in about 20 minutes
All Home Improvement guides
Get one useful guide a week
New home, garden and smart-device guides in your inbox. No spam, and you can unsubscribe at any time.