By abandoning the strategy of defending the Italian peninsula and getting their asses kicked by Hannibal and taking to fight to a defenseless Carthage.
There waere three Punic Wars, Rome won all three and after the final one destroyed Carthage and sold its inhabitants into slavery so there would be no fourth war.