Most farmers I know take their livestock protection pretty seriously. A firearm is but one tool in your arsenal for predator control.
For example, you're not gonna solve a mountain lion problem before there's a problem. Accidentally coming across a mountain lion within range of a 30-30 where he stands there and lets you shoot him isn't a realistic scenario. If there is one in the area that's been a problem for livestock, and has killed, it wouldn't be an isolated problem for you. Plenty of lions out there who kill elk and deer that compete for food resources for livestock. Ranchers leave those lions alone. It's only when a lion kills a few cattle that they set out to find it. It would be a concern for the industry in the area. You hunt lions with dogs or traps, which usually means hiring somebody.
Most states will not allow you to just go out and shoot any old predator you find on your property. Lions and bears are game animals, if they're out of season, or you have no tags, just because they're present on your land doesn't mean you can kill them. As an owner of livestock, you can get a depredation tag for a specific animal if warranted. If you own 5000 acres, and come across a black bear cub (and kill it) 2 miles from your chicken coop, it would be tough to justify to a game warden that you were worried about your livelihood.
Raccoons problems are far more effectively solved with traps.
Coyotes, as a part of an ecosystem, both solve problems and create them. Killing them for sport can be turned into an artform (witness the thousands of YT videos on the subject). But like other predators, there are effective deterrents and proofing you can do before resulting to lethal control.
If you could be more specific about what state you live in, what livestock you have and how many, how big your farm is, what does the landscape look like, and anything else that could provide more specific advice.
The easy answer to "I want a varmint gun" is to take your current AR15, add a good trigger, and build a hot .22 centerfire upper. You can go with .223, but the new hotness is .224 Valkyrie. There's .22 Nosler and a few others, but for preds, you want far, flat, and fast. Smaller holes leave better pelts, and there's plenty of energy in the modern calibers for your average predator. Keep the distances reasonable with black bears, but feel free to hit yotes and cats out to 500yds if you can swing it. The old "bolt guns are more accurate" argument is total crap until you start getting into real money. Buy just about any $100 single-stage trigger, a and a good name-brand upper, and feed it quailty ammo or tuned reloads.