It is best not to hike with dogs, as they can antagonize bears and cause an attack. An unleashed dog may bring a bear back to you. Learn about bears. Anticipate and avoid encounters. Know what to do if you encounter a bear.
Odours attract bears.
Reduce or eliminate odours from yourself, your camp, your clothes, and your vehicle. Don't sleep in the same clothes you cook in. Properly store food, including pet food, so that bears cannot smell or reach it. Don't keep food in your tent - not even a chocolate bar. Pack out all garbage.