In a chemical reaction, bonds in the reactants are broken and new bonds form in the products. Breaking bonds takes in energy from the surroundings, so it is endothermic. Making bonds transfers energy to the surroundings, so it is exothermic. Energy is not released when a bond breaks.
Each type of bond has a bond energy in kJ/mol. To find the overall energy change, add up the energy needed to break all the bonds in the reactants, add up the energy released making all the bonds in the products, then use
energy change = energy of bonds broken − energy of bonds made
Example: H2 + Cl2 → 2HCl. Bond energies are H–H 436, Cl–Cl 243 and H–Cl 432 kJ/mol. Bonds broken: 436 + 243 = 679 kJ/mol. Bonds made: 2 × 432 = 864 kJ/mol. Energy change = 679 - 864 = -185 kJ/mol.
A negative answer means more energy is released making bonds than is needed to break them, so the reaction is exothermic. A positive answer means the reaction is endothermic.