In the third season episode "Lawman Barney", Barney and Andy are trying to get rid of two farmers illegally selling produce on the side of the road. After running scared the entire episode Barney finally talks straight to them and makes them back down, something even Andy had failed to do.
Barney: Do you see this badge? It says that I'm sworn to uphold the law. Now that's what I mean to do and you fellas better respect it. Understand? It's just as simple as that. (Both men step up into Barney's face and stare him down.) Barney: ...you're both a lot bigger than I am, but this badge represents a lot of people who are a lot bigger than either one of you. Now, are you gonna get out of here? (Both men look at each other, then walk off without a word.)
In "The Sheriff Without a Gun," a group of bank robbers comes into town pretending to be a film crew and attempt to rob the bank at night. Barney falls for it initially, but when Andy walks in he realizes immediately that they're up to no good, because he spots that the lock has been forced at a glance. One of the robbers smirks and reminds him that Andy doesn't carry a gun, going to draw his own weapon.
Andy: Ah, that's right, I don't carry a gun. [beat] But my deputies do. [cut to Gomer and Floyd outside, carrying weapons]