In a reaction, bonds are broken and then bonds are made. For bonds to be broken, energy is taken in from the surroundings and when bonds are formed, energy is given out. The overall energy change of the reaction depends on how much energy is transferred in these processes.
When energy is taken in from the surroundings, the enthalpy change is positive. This is an endothermic reaction. When energy is released to the surroundings, the enthalpy change is negative. This is an exothermic reaction.