Believe me, if you are in an area, especially in a national park, where bears are an issue, there will be plenty of signs and instructions on what to do.
However, I believe that the more educated you are on something, the more comfortable you are going to be in the off-chance it does become an issue. I suggest reading this article that will give you tips on camping and hiking in bear country. It will also tell you what to do if you do encounter a bear.
I have camped in many dozens, if not hundreds, of campgrounds in my life. I have logged a lot of miles hiking. My husband has spent much more time in the woods than I have because he is also a hunter. And neither one of us have ever encountered a bear. Oh, my husband has seen evidene of bears (scat, footprints) and he has seen them way off in the distance (little specks even when using binoculars or scope) but never up-close. And we have camped/hiked in known bear country.
Since you are going to Yellowstone, and that is probably the place you would be most likely to encounter a bear (but still rare even there), you might want to read their tips on bear safety here. (Scroll about half-way down the page.) And then you might want to follow their suggested link to safety on the trails.
But, like Michael says, the chances of you encountering a bear are so rare that your chances of being struck by a meteor are probably higher.