Heck sometimes I just abstract attacks rolls, roughly estimate probabilities and just roll a d6 (guards hit on a 4 and deal 6 damage, goblins hit on a 5 and deal 4 damage). The players hear dice rolling, and it looks the same to them as rolling mittfuls of dice they never really get to experience would.
I've been known to roll d6s for NPC vs NPC, but if so it's more "kill on a 6" - if you are still going to the effort of deducting NPC hit points you might as well invest in a pile of d20s, decide how many attacks each side gets, and just roll them en masse. You can add up damage and deduct that many enemies whose hp are exceeded, but it's more realistic to assume around 50% of damage is 'wasted' on non lethal wounds and overkill - you can just increase NPC hp by 50% for purposes of resolution.
So eg 10
Guards ATT +3 AC 16 hp 11 (16) dam 4 attack 12
Goblins ATT +4 AC 15 hp 7 (10) dam 5:
1. Roll 10 d20 for the 10 guards, they hit on a 15-3 = 12+. Every 10/4 = 2.5 > 3 hits removes a Goblin.
2. Roll d20s for the surviving Goblins, they hit on a 16-4 = 12+. Every 16/5 = 3.2 > 4 hits removes a Guard.
At the end of the battle the survivors will have taken hits up to 50% of the total damage inflicted on their side, but will still have at least 1 hp each. So eg the 11 hp guards will have taken 0, 1 or 2 5-hp hits each. You probably don't need to worry about this though.
You can pre-calculate and factor in average critical hit damage if you like, eg guards do 2d6+1 = 8 on a crit, goblins do 2d6+2 = 9 on a crit. This is effectively identical to a crit being 2 normal hits.
We can easily abstract this down to:
Guards ATT +3 AC 16 hits 4 damage 1 (crit 2)
Goblins ATT +4 AC 15 hits 3 damage 1 (crit 2)
Or don't use the +50% hp if you want it faster & bloodier:
Guards ATT +3 AC 16 hits 3 damage 1 (crit 2)
Goblins ATT +4 AC 15 hits 2 damage 1 (crit 2)
After all that work we see that the result is effectively the same as "Guard kills goblin on a d4 roll of 4" and "Goblin kills guard on a d6 roll of 6"
5e goblins are unusually high damage & squishy; in most caes you can get a perfectly decent result by going straight to "NPC mook kills NPC mook on a d6 roll of 6".