Hi,
First of all welcome to the forums.
Second of all, you just failed because you don't know how the Civil War and new Politic overhaul (made by CA not by us) works.
Civil Wars are easily avoided if you pay attention to parameters like
Loyalty. The more loyalty a party has towards you, the less they will break and so no CW will happen ever.
So how to increase loyalty? well
winning battles with those other party generals is a good start, next you can check if they have (or maybe it interest you) an statemen and you do one of those 3
Statemen jobs.
Furthermore, you can
promote the generals and most importantly you can
check what are their requirements: each political party will have 3=2 from the party itself(never changes)+1 from it's leader.
Civil Wars does not trigger anymore (thanksfully) by spawning 20238947 armies/fleets around your capital, wich was certainly a broken mechanic. Parties with the lowest loyalty will break appart (seccesion) or more than 1 can do it while others will stay by your side (civil war). So you should always keep an eye on the Global map (what @Dardo21 explained above) to be ready just in case.
Honestly, if someone triggers a civil war non intentionally, it means that person have done things pretty bad.
An advise: I know you feel frustrated due to all your loses in your campaign, but trust me raging without getting to know the mechanics before playing is a noob move. Next time come to the forums before it's too late.
We will gladly help you always