If a recession does hit, it might also affect the stock market, and different companies and sectors will perform differently.