You can find several articles online that tell you what to do and what not to do if you encounter a bear. Bears are large and very strong.
Dos and don'ts include:
1) Stay Calm, Back away slowly to show you are not a threat, speak calmly
2) Do not make quick movements, but move slowly, keeping an eye on the bear
3) Do not climb a tree, because they can climb faster than you
4) If you are hiking, talk loudly and make noise. That may scare any bears away.
But enjoy this video, edited by Jessie Britton of a backyard bear at a house in the wildland urban interface.