To answer a question with a question . . . what's the most important piece of safety equipment when riding a bicycle? Hint: It's NOT a helmet.
The most important piece of safety equipment when riding a bicycle is a safe bike. What does that mean?
First, the bicycle should be well made. Unfortunately, many discount store bikes don't meet this criteria.
Second, the bike should be in good working order. Check brake pads, tire air pressure, chain condition. Look for parts that are missing, damaged, or loose.
Finally, regardless of age, a safe bike should fit the child properly.
A local bike shop will carry quality products and can help you find the right fit for your child. If cost is a factor, you can look for a used bike, but here it would be a good idea to enlist a bike shop to give it a once over to make sure it's road worthy. You can also look for bicycle safety events (sometimes called "Bike Rodeos") in your community -- many of these will offer bicycle safety checks for free. These events will also teach your child how to make the most of their bike with tips for riding safely and confidently.
If you're buying a bike for an older child (ages 10 and up, depending on height), talk to the bicycle store about a model with a smaller frame but larger wheels and adjustable seat posts and handlebars. You can maximize your investment in a good bike by getting something that will fit them through the high school years.
Happy riding!