Look for videos of African hunters shooting a charging lion. It takes balls of steel, incredible accuracy for a CNS ( the only thing that will drop it in its tracks ) shot on a charging animal and a capable round. My point is this is a lot harder to do successfully than what most people think. Especially so if you are not ready for it, which you won’t be if just hanging out on your property and not actually hunting.
My suggestions:
Talk with the local game warden on suggestions for making your property less attractive to bears
Get a big, alert protective dog. This will give early warning of a bears presence, most bears avoid dogs, and will provide a distraction for a bear that doesn’t avoid a dog. Hopefully giving time to get to safety.
Rifles, fast handing one in an substantial caliber with dangerous game bullets rule, but you can’t carry all the time. A 44mag or bigger cal wheel gun is a 1st choice for manny but are heavy, and difficult to shoot for most people. A friend who lives in Alaska tells me that 10 mm 1911s with Corbons are a popular choice for this purpose. This could easily be carried and is easier to shoot that a 44 mag.
Mount some bear sprays on the outside of the barn like a fire extinguisher to keep them handy.