Teach your child to fear things that should be feared and WHY.
For example, my son as a toddler was this way. I had to teach him to fear cars so he wouldn't run into the street and look both ways. (He'd run into the street and then in a fit of toddler anger stood there with his hand up telling to stop so he didn't have to move. I got to him first.)
Teach your child the horrific consequences of violating various safety rules so that the child isn't trying to do something you know is dangerous while asking WHY. This is the only thing that got my son to stop sneaking into the garage to try to mess with Dad's tools, including accidentally activating a press.
My son having seen the safety videos on guns and explosives is why he was able to stop several friends and report to me they'd found explosives. I called in a neighbor, and he showed the boys safely what to do with the fireworks. Ditto on safety videos on guns, so the boys did the right thing when they found one. They understood if this goes off, your head could explode like that watermelon in the video, not the exciting pew-pew of video games.
When you teach them the danger very early so they have a healthy dose of fear, they internalize the limits so you don't have to be afraid.
If they are ignorant of the danger, they don't take the right safety precautions and don't understand why they need to seek guidance with the unknown.