Your confusion is understandable. I looked at the answers linked in the comment on your OP, and I'd like to explain it differently from how they do. Hopefully this explanation will get to the heart of your confusion.
You are thinking (incorrectly) that an exothermic reaction works something like this:
The system has a certain amount of thermal energy. In an exothermic reaction, some of the system's thermal energy is relased to the environment, and thus the system must lose thermal energy and thus decrease in temperature. I.e., you're imagining something like what happens when a warm block of metal is placed in a cool cup of water. The metal releases some of its thermal energy to the water, and thus cools.
But that's not what happens in an exothermic reaction. In an exothermic reaction, the system internally generates extra thermal energy. This is generated through a chemical reaction in which chemical energy (essentially, the energy in chemical bonds) is converted to thermal energy. Now, if the system is internally generating extra thermal energy, any of a number of things can be done with this energy. The two most common pictures are as follows:
The system is in a large (relative to the system) constant-temperature heat bath, and is surrounded by diathermal (heat-conducting) walls. In this case, because the temperature of the system is kept constant, the thermal energy flows out (i.e., is released) into the bath.
The system is adiabatic, i.e., is surrounded by a perfect thermal insulator. In this case, the extra thermal energy stays within the system, causing its temperature to increase.
The reverse of what I wrote above applies to an endothermic reaction.