Sometimes the exact good a consumer wants isn’t available. If a recipe calls for cashews but the grocery store doesn’t have any, a consumer may buy peanuts instead. In this case, the peanuts are considered a substitute good.
For a good (e.g. peanuts) to be a substitute for another good (e.g. cashews), demand for the good must increase in response to price increases for the other good (e.g. cashews).
When the value of one product (e.g. ice cream) is increased by another good (e.g. ice cream cones), they are considered complementary goods.
Complementary goods are also defined by their relationship around price. When the price of ice cream increases, demand for ice cream decreases. In response, the consumer demand for ice cream cones decreases.
When a price increase for one good (such as yoga mats) has no impact on the price of another good (ice cream cones), they are considered independent goods.