Other goods can have one of three relationships with the good that we are examining. Other goods could be complements, substitutes or independent goods. Of the three, independent goods are the easiest to understand. This is because independent goods are not related to each other so a change in one good does not affect the other. An example of independent goods are peanut butter and rubber bands. No matter what happens to the price of peanut butter we can be sure that there will be no discernible difference in the demand for rubber bands.
Substitute goods are goods that can be used in place of other goods. An example of substitute goods is Exxon and Shell gasoline, you either buy Exxon gas or you buy Shell gas, you don't normally buy both. When the price of a good changes the demand for the substitute good moves in the same direction. Continuing our example, if the price of Exxon gasoline increases most people will change their purchases to the lower priced gasoline, Shell. A higher price of Exxon gas caused the demand for Shell gas to increase.
A complementary good is a good that is used in conjunction with another good. An example of a complementary good are hot dogs and mustard, when you buy a hot dog you usually buy the mustard to go on the hot dog. When the price of a good changes the demand for its complement moves in the opposite direction. Continuing our example, if the price of hot dogs increases, people will buy fewer hot dogs. The lower sales of hot dogs means that people will not want as much mustard so the demand for mustard decreases. A higher price of hot dogs caused the demand for mustard to decrease.
To help bring this concept together let us look at what happens to the demand for soda, peanuts, and olives when the price of beer increases. Most people would view peanuts as a complement for beer (many people drink beer and eat peanuts at the same time), soda as a substitute good (you drink either beer or soda) and olives (beer and olives?) as an independent good. When the price of beer increases the demand for peanuts would fall (complementary goods), the demand for soda will rise (substitute goods), and the demand for olives would remain unchanged (independent goods).