A bear on your land is not an emergency by default. Most are passing through, following their nose. The goal is simple: make your place boring and unrewarding, and give the bear an easy way out.
In the moment
Keep your distance and stay calm. Bring children and pets inside. Do not run, and do not crowd the bear or block its exit. Give it space and time to leave on its own.
If it is close and you need it to move, make yourself known: stand tall, speak in a firm, low voice, and back away slowly. You are not trying to punish the bear. You are telling it this is not a place to linger.
What not to do
Do not feed it, ever, even by accident. A fed bear comes back. Do not corner it, and do not get between a mother and cubs. Do not reach for a lethal answer to a problem that attractants and awareness solve far better.
After it leaves
Walk the perimeter and find what drew it in: a bird feeder, a full trash can, a greasy grill, pet food on the porch. Remove the reward and the visits usually stop. Awareness plus a clean perimeter does more than any single dramatic moment.