Years ago my next door neighbor had two nice Labs (one chocolate, one older black).
When the neighbors were at work during good weather, the dogs stayed in their fenced back yard all day. For the first few years there were no problems, as they didn’t bark much at all.
Then one Spring the young chocolate Lab started barking incessantly hours on end for several days in a row.
By the second week it was getting really annoying, and I checked them out closer to discover that an asshole squirrel was sitting on a tree branch above the Lab chattering away, baiting the dog. I threw some pebbles at the tree rat and missed, not fazing it at all.
The next day when the racket started up again, I went to Academy and bought some .177 pellets for the Daisy 880 - it can shoot them single shot. Went home to see the squirrel was still at it in the tree.
So, standing on my back patio I loaded a single pellet after pumping the Daisy and shot the asshole tree rat off that branch and the Lab pounced on it to make short work finishing it off. Good dog.
Problem solved.