Substitute and complementary goods

How do substitute and complementary goods affect the demand for a good?