http://ffxiv.consolegameswiki.com/wiki/Crafting

You have 2 basic abilities for crafting: Basic Synthesis and Basic Touch.

Basic Synthesis increases Progress. When you reach 100% Progress, you make the item.

Basic Touch increases Quality. When you reach 100% Quality, you have a 100% chance of making a HQ item.

The trick to crafting is to increase Quality as much as you can before you reach 100% Progress, while making sure your durability doesn't reach 0.
This is usually done by using Basic Touch (and related abilities) first, then using Basic Synthesis (and related abilities) to reach 100% progress and successfully craft the item.