I just finished the my second Punic War with Carthage, Numidia, and Egypt and it lasted 20 long years. Carthage declared war on me and I suffered a few defeats initially but eventually rebounded. My navy was divided into four fleets with about 15 ships each. I found the main Carthaginian navy which had a huge stack of 28 ships. One of my fleets was caught by this monster and was eventually destroyed. I combined two of my other fleets to take on the main Carthaginian navy and eventually won the battle without taking severe casualties. Meanwhile, my other unengaged fleet transported one of my legions (~15k troops) to take the Balearic Islands. The Balearic Islands MUST MUST MUST be taken: its western location makes it an ideal naval base to reduce your supply lines for your navy and moreover, it allows you to blockade the Western African provinces and the Spanish provinces and the most important thing, it allows you to cut off Spain from Africa. In most of my games, Carthage usually has 2/3 of her troops stationed in Spain.
After destroying the Carthaginian navy and blockading all of her major ports, I begin to land troops in the least defended locations, which usually tends to be the modern day Libya area. The purpose is to build up a base of operation and to consolidate your armies to eventually meet and destroy the monstrously large Carthaginian armies. Eventually, Carthage will go broke and its manpower will deplete and it's armies in Spain won't be able to help out Carthage proper. You'll really want to ask your ally Massalia to help out since Numidia is usually allied with Carthage, which makes a favorable treaty difficult.
In my own game, I probably spent over 1000 gold and 200,000 manpower and 4/5 of my entire army to take on Carthage, Numidia, and Egypt. Massalia and I were able to conquer all of African Carthage, Numidia, and I had pushed Egypt all the way back to her Nile territories and pushed no further (they were still immensely rich and had a huge 60k army). I was only able to maintain my war with these superpowers by constantly looting the captured territories (using Rome Enhanced mod) but I couldn't push any further because all of my territories were in constantly rebellion and the Gallic tribes had just declared war on me and my Northern Fronter was immensely weak and Massalia had signed her own peace treaty with Carthage. But eventually, I was able to achieve a warscore of 80% and force Carthage to secede huge amounts of territory and pay large amounts of gold.
So in short:
1) Destroy the Carthaginian navy
2) Blockade the main Carthaginian ports, cut Spain off from Africa
3) Take Carthaginian islands to reduce your supply lines
4) Land your troops on Africa and engage the main Carthaginian armies when possible
A strong navy is the only thing that makes winning a war with Carthage possible.