Find a swarm of flies.
Unequip your weapon, ensure you're wearing good armor.
Hit a fly. It will split into 2.
Hit the new fly. It will split into 2 (you should be up to 3 flies).
Keep doing this until all flies are dead.
Repeat as needed.
Additional remark: Swarms can split only if at least one of the 4 tiles around it is free.
So, if the swarm you’re hitting is blocked (by you, walls and other swarm(s)) you first have to make a step back (in a corridor, the following swarms will generally not follow you, only the nearest will) in order to allow the swarm to split.