The 5M's Rule
There are many factors that effect the production of an espresso, for perfect extraction they must all be right. In Italy they use the 5 M's rule:
Use a high quality espresso blend such as Bristot, whilst it is still possible to make a bad coffee from good blend you can never make a good coffee from a bad blend! Also make sure it is an espresso blend, a single origin coffee is no good for espresso, just because you are buying coffee in bean format doesn't mean it was meant to be used for espresso. A good blend can contain as many as 14 different origin coffee beans from all over the world. The best blends will contain a high percentage of arabica beans, although this will not neccessarily be 100% arabica. Robusta beans have certain qualities that are desirable in espresso so some of the best espresso blends contain a small percentage of very high quality robusta. This is true for about 98% of Northern Italy's blends.
The grinder must be good quality and the blades must be changed regularly (every 800-1000kg for conical blades, every 400-500kg for flat blades). Blunt blades will burn the coffee as it is ground. The grinder must be set correctly in terms of how fine the coffee is ground and how much ground coffee it delivers to the group handle per shot. You are aiming for an extraction in the region of 18-30 seconds. If the grind is too coarse or too little coffee is used the espresso will be under-extracted and watery. If the grind is too fine or too much coffee is used the espresso will be over-extracted and bitter.
The coffee machine must be good quality. Look for machines that are Espresso Italiano approved (such as CMA Astoria), this means the quality of their coffee making ability has been approved by the Italian body in charge of promoting quality espresso. The machine must also be set coreectly for your chosen coffee blend, i.e correct water temperature (88-92ºC for Bristot blends) and pump pressure (8-9 Bar).
It doesnt matter how good your tools are if the operator doesn't know what they are doing! You don't need to be the worlds best barista, but you do need to know a little bit about the espresso process (please also see How to make the Perfect Espresso), so do some research and put in plenty of practice! Regularly check your extraction time is correct, you should be able to see when it is wrong! Ground coffee doesn't keep well, it should be used within an hour so don't grind more than you expect to use in an hour and don't use ground coffee that has been left overnight.
Finally, it is important to keep all of your equipment in good working order. Look after it properly with a daily, weekly and monthly cleaning schedule and regular servicing. Always make sure your water filter is changed at the correct interval.