@anonymoushehe
I think you are making a common mistake in confusing enthalpy with temperature. Temperature is an expression of the kinetic energy of particles. Enthalpy is the total internal energy of a system.
In an endothermic reaction, the temperature of the system goes down because the kinetic energy of the particles that are participating in the reaction decreases.
Let's look at an example: solid ammonium chloride is dissolved in water. The enthalpy change for solution is +14.8 kJ/mol meaning the solution becomes considerably colder than the separate substances.
Note that this has nothing to do with the surroundings. This is an internal change.
Now, why is this happening?
14.8kJ/mol of internal energy is no longer manifesting as heat. It has been absorbed into making new chemical bonds. The internal enthalpy of the system has been redistributed and the Law of Conservation of Energy has been obeyed.
Some of the kinetic energy of the system has been converted to chemical energy in hydrating the ions, hence the solution becomes colder.
In an exothermic reaction, you just reverse all these effects. The enthalpy change of the reaction is negative.
The chemical energy of the bonds decreases and this energy is released to the particles and causes an increase in their kinetic energy so we observe the temperature of the system increases.
Last point: a basic observation in thermodynamics is that heat energy only flows from hot objects to cold objects (and not the other way).
The systems we have been considering also form part of their universe, and heat energy will tend to flow from the universe towards an endothermic change, and heat energy will tend to flow away from an exothermic change towards the universe, until their temperatures reach equilibrium, but this heat flow is quite separate to the internal energy changes.