Of French origin meaning to 'derail', it is most likely the scariest part of a bicycle. While most people have no idea how these mystery components work, they are not as confusing once you understand how they work.
Learning how to adjust a derailleur will save you lots of money in the long run as bike shops charge hefty amounts for adjustments that take them less than a minute.
How does a derailleur work?
A derailleur essentially moves in and out to align the chain with the correct gear on the rear cassette. When you shift gears it either moves in 1 position or out 1 position. That is it, not as scary as you think!
It is important to align the derailleur wheel with the cassette gear, if the derailleur wheel is halfway between 2 cassette gears the chain doesn't know which one it is supposed to be in. If it is off slightly the chain will make noise.
When a derailleur gets to either end of the cassette, you need to make sure the chain doesn't get pushed into the wheel spokes, or fall off the cassette. On either end you have a set screw that prevents both of these events from occurring.
When looking at the derailleur from behind, you need to make sure it is aligned vertically so that the chain shifts smoothly and is not at an angle.
Those are the fundamentals of a derailleur, after you understand those concepts the adjustment process makes much more sense. Please see the following video that shows a derailleur adjustment being performed. No matter the number of gears on a bike, or the derailleur used, the adjustment process is the same for almost all rear derailleurs.