During a chemical reaction the bonds in the reactants are broken and new bonds are made to form the products. Energy must be supplied to pull atoms apart, so breaking bonds is endothermic: heat energy is taken in from the surroundings.
When atoms join to form new bonds, energy is released. Energy is given out when bonds are made, so making bonds is exothermic.
Take hydrogen burning in oxygen. The H–H bonds in hydrogen and the O=O bonds in oxygen are broken, which is endothermic. New O–H bonds then form in water, which is exothermic. Whether the whole reaction is exothermic or endothermic depends on which of these two energy changes is larger.