Essentially, there are two types of filling: silver amalgam and composite (white) fillings.
Amalgam has been in use for about 150 years and is a safe and very durable material.
Composites are in use now for about 50 years and the material and the technique are improving all the time, so that they are now nearly as durable and long-lasting as amalgam. Composite is the material of choice for filling front teeth and is becoming more and more common in back teeth as well.
Normally amalgam is the first choice filling material in back teeth as it is stronger, more durable and more economical than composite, but composite is of course better-looking and even indistinguishable very often from the natural tooth substance.