How does the law of conservation of energy agree with the fact that in the course of a chemical reaction either

How does the law of conservation of energy agree with the fact that in the course of a chemical reaction either the release or the absorption of heat occurs?

Energy does not arise from nothing and does not disappear without a trace, but its individual types can pass into each other according to strictly defined equivalent ratios.
So, if the energy of chemical bonds in the reaction products is greater than in the reagents, then the energy can be released in the form of heat, and if less, then the energy in the form of heat can be absorbed from the outside.
Those. here there is a transition of thermal energy into the energy of chemical bonds and vice versa.

Remember: The process of learning a person lasts a lifetime. The value of the same knowledge for different people may be different, it is determined by their individual characteristics and needs. Therefore, knowledge is always needed at any age and position.