Where will you be hiking? Is it bear country if so what species of bears are around, are they likely to have encountered humans before? Chances of bear encounter in the lower 48 are much lower than in Alaska. There have been some nasty attacks in Yellowstone in the back country too.
I've spent quite a bit of time in the woods in Alaska, bells, horns, for prevention anything that makes an unnatural noise works very well, it doesn't have to be loud enough to be annoying. Yelling works but can get old after a while. The only trouble we've had with bears was during hunting with scent block when neither party knew the other was there
.
Fish and Game did a study with salmon researchers, the researchers were having trouble with bears. After they started blowing portable compressed air horns before retrieving salmon encounters with bears were almost eliminated.
Bears typically want to avoid humans, but they sometimes need help identifying us. Stay alert to terrain and plant life, for example before going over a hill or anywhere visibility is limited make some noise. Humans like berries, so do bears, it is just something you learn to keep in the back of your head.
Reading up on bear behavior is important too, they have body language and vocalizations just like humans and dogs.