Welcome in the wasteland
The best way to fight and kill human NPCs while farming is straight bursting weapons, such as combat shotguns (small guns) and light support weapon (big guns). These weapons use low amount of ammo 4 or 5 each burst. Submachineguns are also good for crouwds or melee, like the tommy gun or the grease gun, but they drain more ammo. Flammer is a good solution aswell, easy to craft and cheap ammo. The damage is good but the range sucks. For bigger creatures or faster farming, my favorite is the XL70E3. This assault rifle requires lvl 2 SG to craft, and lots of materials, but the ammo is cheap to craft and the damage enough to kill any npc at point blanck (called "hex"). It's easy, switch to burst mode and go as close as you can from another npc and attack.
For the fight itself, use the stupidity of the ennemy. The obey some rules you can turn against them. First, they will move forward if their hitchance is low, so you have a chance to attack first and kill one or 2 at start. Then, they never attack if they have allies in their line of fire, so you can "take cover" behind a melee raider to avoid shots from the pistol one. He will then move until he gets an angle at you and shoot, repeat the action for more time.
Learn to manage your action points. They only regenerates when you stand still. Don't move if you do not need to the time you spend moving adds delay to your next attack. Use stimpacks on yourself, as well as first aid kits and such. You may set up some shortcuts with FOconfig.exe.
If you HPs are low, heal, run only if its a melee creature or if you want to flee. Don't waste action points on ennemies that have negative HP, they are not a threat anyway, focus on the standings ones. Keep some action points when you fight, if the fight is dangerous, you should keep 5 ap. Having these AP will save your ass if you get hit badly, because you will be able to use a stimpack or FA without waiting, and in case you get critically hit and knocked down, you will raise faster. If you have to choose between shooting and healing, check your HP as well as the ennemie's. If you are sure to kill him with your next attack, shoot. If you are not, heal. Reloading should be done after healing if it's needed. First heal, then reload.
If your encounter holds groups of NPC fighting each other, don't get too close, but close enough so you have good hit chance on everyone. SHoot once anyone moving towards you, they will change target if you hit them first. Then watch and wait, use F7 to see their HPs, once a npc is very low or negative HP, shoot him single shot to get the xp (having fastshot helps), if one groups is bigger than the other, attack the bigger one to make it even and make the fight last longer. You should be able to get quite some xp like that, without using many ammo or drugs.
Don't attack non aggresive NPCs (mostly city patrols, traders, followers of the apocalypse, mutant remnants, regulators, brotherhood patrols and such).
Last but not least, if someone spawns on you when you are fighting, use the NPCs as meat shields. Estimate your chances of winning the fight with that player. If they are low, run away using as much cover as you can. If you can win, hide behing some NPC, heal and wait for your action points. Once the player has bursted you throuw the NPC, killing it, attack yourself. Remember that whats it true for NPCs fighting is also true for players, you should manage your action points the same way. If the player is something with more than 260 hp with a combat armor, don't ask yourself too many questions, just run away.
Good luck