Step 1: Inspect the inner and outer limit. There should be 2 mm spacing between inside the chain and the front derailleur cage. If there is less or more than 2 mm, turn the inner limit screw in or out, until the right amount of clearance if achieved, usually the innermost or uppermost of the pair of screws on the derailleur body.
Step 2: Shift to the smallest cog and biggest chainring. The outside of the cage should clear the chain by 2mm. if not, adjust the outer limit screw.
Step 3: Set cable tension. Here are two ways according to the types of bikes, making sure you get really precise shifts.
For mountain bikes:
Shift the chain onto the middle chainring and biggest cog. If the chain rubs the outer plate of the derailleur, you need to tighten cable tension. Shift back to the small ring and loosen the cable anchor bolt. Turn the barrel adjuster (at the shift lever) all the way in, then back in out one complete revolution.
Pull the cable taut with your fingers and retighten the anchor bolt. Shift back to the middle ring. If the chain still rubs, turn the barrel adjuster out a quarter-turn at a time until there’s no contact.
Then shift to the smallest cog while staying in the middle ring. If the chain rubs the inner plate of the derailleur, you need less cable tension.
Turn the barrel adjuster in. Once the chain doesn’t rub either side while in the largest and smallest cogs, you may need to alternate adjustments a few times till the tension is fit.
For road bike:
If the chain is working slowly when shifting from the small ring to big, you need tense the cable more. Either turn the barrel adjuster on the downtube cable housing to stop out a quarter turn at a time until the shift is crisp, or loosen the anchor bolt and turn the adjuster all the way in then one revolution out.
Pull the cable tight with your fingers then retighten the anchor bolt.
Step 5: Once the chain is on the big ring, shift to the smallest cog. If the chain rubs the outside plate of the derailleur, pull on the derailleur cage with your hand; If you can stop the rubbing with little force, you simply need more cable tension; If the derailleur resists when you pull it, you need to readjust the outer limit screw.
Step 6: Clean the derailleur. Grit that builds up on the body can work its way into the moving parts, causing premature wear and sloppy shifting. Leave the derailleur on the bike to clean it. Wipe with solvent and a rag.
Step 7: Lubricate the pivot points that two parts that move jointly. Let the lube dry 10 to 15 minutes, and then wipe the excess away with a clean rag.