Once the battle is over, soldiers would affix a bayonet to their rifle/musket and they would literally just walk the battlefield and drive their bayonet through the bodies of all enemy soldiers.
Prior to muskets and rifles, they’d use swords, knives, and arrows.
Latest Answers