Red Dead Redemption 2 features various melee and ranged weapons with different stats that make them useful in a wide range of situations, hopefully prompting you to try them out as you progress through the game. Guns don't stay the way they are when you obtain them, however, as there are ways to improve their features and make them even more useful.
The most obvious way to improve all of the available firearms is by upgrading them at Gunsmiths - there you can obtain a superior stock, barrel, scope, etc. But there is another, less known way to make them better: improving weapon affinity. This works in both single player mode and Red Dead Online too.
The more a firearm is used, the more Arthur Morgan (if in story mode) or your Red Dead Online character will improve in handling it. Repeated use of the same weapon will bring enhancements for all of the weapon's stats such as accuracy and reload speed. They are negligible at first, but they become much more noticeable as affinity increases. You can check the current affinity level for obtained weapons in the Compendium.
While there is no shortage of living targets to shoot at to improve affinity, you need to be extremely careful if you don't want to amass a huge bounty in any of the game's regions. Shooting at random NPCs both in inhabited areas and on the road will do just that, and a high bounty means the law being on a constant search in all towns and cities. Plus, you'll bounty hunters trying to ambush you at every corner while on the road.
There are two ways to increase weapon affinity without having to deal with high bounties.
The first one is to shoot at wild animals. The most common animals, like bucks and other small and medium-sized animals, will not retaliate when shot at, so you can increase your affinity with any weapon with impunity. If you like a little risk, however, you can make improving affinity a faster affair by going after alligators, mostly found in the Bayou Nwa region, to the north of Saint Denis. They are extremely resilient, and only sniper rifles can deal significant damage in a shot. They will retaliate, though, so make sure to have your horse nearby if you fail to kill them before they get to you! Bears are also good targets for increasing weapon affinity, but they much faster than alligators and they can catch you, even if you are on horseback, if you are not quick enough.
The second way to improve weapon affinity without getting a bounty is by targeting undesirable people. Make sure to complete every Bounty Hunting mission in story mode available to get the chance to shoot at humans without getting yourself a bounty in return.
As Wanted men and women are worth more alive, we suggest you disarm them by shooting at their guns. Many of the random events happening 24/7 around the RDR2 map involve less than savory individuals, so shooting at them will usually come with no penalty.
Clearing Gang Hideouts is also a good way to improve affinity without consequences. Just be aware that they are available in limited numbers in story mode, so you cannot clear them over and over like it's possible to do in Red Dead Online.
No matter the method chosen to improve weapon affinity, make sure to bring some gun oil with you. Your weapons' conditions will worsen the more they are used and they must be maintained otherwise performance will suffer. Learn how to maintain your weapon here.