(i) If with fall in the price of X, demand for good Y rises, they are complementary goods. For example: Car and petrol. When price of car decreases, demand for petrol increases.
(ii) If with fall in the price of X, demand for y falls, they are substitute goods, For example: Tea and Coffee. When price of tea falls, demand for coffee falls.