In order to understand whether a reaction in a chemical equation is endothermic or exothermic, we must first define these terms. An endothermic reaction is any reaction that has to absorb energy from the outside environment for the reaction to occur. An example of this is melting ice (although this is a state change, not a reaction), which requires heat from an outside source for the reaction to occur. An exothermic reaction is the opposite, and is therefore defined as any reaction that gives off energy to the surrounding environment when it occurs. An example of this would be an explosion which gives off energy to the surrounding environment as both light and heat.
To answer your question, there is a way to predict if a chemical reaction will be endothermic or exothermic by looking at the chemical equation. The differences between an endothermic and exothermic reaction are considered differences in enthalpy. The net difference of the enthalpy for all the products in a chemical equation determines if the reaction is endothermic or exothermic. These enthalpy values are known as `Delta`H and are calculated using the formula `Delta`H=energy of the system+PV, where P is pressure and V is volume. Net values are calculated for each of the products going into the reaction. If the `Delta`H value is positive, the reaction requires the addition of energy and is endothermic, however if the ``H is negative the opposite is true, and the reaction is exothermic and gives off energy to the surrounding environment. Hope this helps!