How does pollution change the temperature of our planet?
By trapping solar energy.
I believe you are referring to air pollution and the greenhouse effect.
Energy from the sun travels freely through the atmosphere to the ground. At this point the energy is short wave radiation. Short wave radiation does not heat the atmosphere it only heats the solid objects it comes into contact with, like your skin or the ground. At this point the ground gets warmer and as it gets warmer it releases heat or long wave radiation. This heat warms the atmosphere, and unlike short wave radiation, it does not pass freely through the atmosphere. Certain trace gases in the atmosphere retain this heat.
There is no problem with these gases retaining this heat. It is all part of the solar balance, which is how the Earth radiates the same amount of energy into space that it receives from the sun.
Basically it is like a pressure cooker. If the heat remains constant on a pressure cooker it would get really really hot, because more heat would be being applied and none would be leaving. Now if you have a valve on the pressure cooker you could open it to the point that the same amount of heat that is coming into the cooker is leaving the cooker through the valve and the temperature would remain constant.
Now the trace gases I referred to before are things like CO2 and CH4 which are both considered air pollution. The problem is when the amount of these gases increase. The effect would be the same as the effect that closing the valve a little on the pressure cooker. The heat would go up.
The reason it is referred to as the greenhouse effect and those gases are greenhouse gases is that like a greenhouse, sunlight shines freely though the glass but the heat that is created is trapped by the glass.
I hope this is understandable and that it answers your question.