There are two tricks for installing a cable for your front derailleur.
First is getting the tension right, which isn’t all that tough… If you start out in the right gear. Before you take off the cable the front should be on the smallest chain ring. This is wrong:
This is correct:
The second trick is properly routing the cable over the derailleur bolt. Something as simple as running the cable on the wrong side of the bolt will mean your bike won’t shift. There is a little ledge, call it a finger, the cable runs over:
From there it runs under the washer:
Once you get the routing correct, it’s just a matter of pulling the end tight with a pair of needle-nose pliers and tightening the bolt.
When I did that cable, I didn’t even have to index the derailleur, it worked perfectly.
If you don’t know your derailleurs, take a closeup photo that shows how the cable runs at the bolt before you remove the old cable so you can look at it after you run the new cable.