Changing the temperature of a system at equilibrium also changes the relative amounts of reactants and products. The system counteracts the change. If the temperature is raised, it favours the endothermic direction, which takes in heat. If the temperature is lowered, it favours the exothermic direction, which releases heat.
If the temperature of a system at equilibrium is increased, the relative amount of products increases for an endothermic reaction and decreases for an exothermic reaction.
If the temperature is decreased, the relative amount of products decreases for an endothermic reaction and increases for an exothermic reaction.
For example, in the Haber process N2 + 3H2 ⇌ 2NH3, the forward reaction is exothermic. Raising the temperature therefore decreases the relative amount of ammonia at equilibrium, so the yield is lower. Lowering the temperature gives a higher yield. You may be given data about a reaction and asked to predict the effect of a temperature change.