bear attacks happen very rarely. Even though this is the case, it is always necessary to be prepared. The main thing in bear attacks is which bear species you are facing. because the way of attack from species to species and what you need to do may vary.
The best thing you can do is not meet the bear. If you are walking in the forest, take a branch and hit the trees. so the bear will be aware of your presence and you most likely won’t even see the bear.
This guy became a friend with bear