I started typing up a long ass comment. Problem with this is, not that I don't agree, but you have to think about action and reaction here. I completely believe if you have to deal with looters, thieves, criminals, etc. you need to do it swiftly. The longer they're around the more time they have to analyze your strengths and weaknesses as well possibly test you. There are a number of possible ways of handling them without even lifting a firearm. The "Trojan Horse" approach with some of Dsarti's crazy ass videos as inspiration. There's also a scorched earth approach. Scarying them off. I've often considered buying some surplus Halloween gore.............hey, you've got to be creative. Nothing says "Oh shit!" Like fake blood all over the front porch and a fake skull on a stake. Maybe even a few limbs. Ya know, really gore it up lol.
Problem with the reaction is you have to be careful about what you're messing with. Are you defending from a group of six, or are you fighting off six from a group of 60? If some don't come back others will go looking. The other side of that is think about gang mentality. If you gain a reputation for taking out gang members and thugs then they might start looking at taking you out as "street cred" or whatever the phuck they call it nowadays.
When it comes to farmers and larger areas it's really hard to say. Not to be cruel, but it'd probably be wise to have guards watching over them. To the foreign eye the guards may appear to be inforcing the workers in fields.
Last thing, if you're really confronted with a group it could be beneficial to offer up a treaty. Might sound stupid, but it could work to your advantage in a number of ways. Even if it does just buy you time to plan an attack on them or lower their expectations of one occuring. Anyway which way you have to do it, be brilliant about it.
Best advice I can give is there is strength in numbers. Immediately after something occurs it'd be better to start getting people on board than waiting for things to calm down a little. That's why, despite some criticism, I believe my prepping goods aren't just for me and my family. If you can offer someone food, shelter, and security they can likely offer you work, loyality, respect, and hopefully a skillset in return. Oh, I don't mean guns though. I'm nice, I ain't stupid.