A reaction can only happen when the reacting particles collide with each other and with enough energy. The smallest amount of energy that particles must have for a collision to cause a reaction is the activation energy. Even a reaction that releases energy overall needs this energy to get started, which is why a fuel does not burn until it is lit.
A reaction profile (an energy level diagram) shows the relative energies of the reactants and the products as the reaction goes on. Energy is on the vertical axis and the progress of the reaction is on the horizontal axis. A curved line starts at the reactants, rises to a peak and then falls or rises to the products. The height from the reactants up to the top of the peak is the activation energy. The vertical gap between the reactants and the products is the overall energy change.
In an exothermic reaction the products are lower than the reactants, so the products have less energy and energy is released to the surroundings. In an endothermic reaction the products are higher than the reactants, so energy is taken in from the surroundings. Comparing the two levels tells you which type of reaction it is.