The answer is in mitochondria, during cellular respiration.
ATP is main fuel for the cells' functions. It is produced in mitochondria in the process of cellular respiration.
Cellular respiration is a series of metabolic reactions in which biochemical energy from nutrient is converted into ATP. In cellular respiration, glucose and oxygen yield water and carbon dioxide.
So, a general reaction could be represented as: glucose + oxygen → carbon dioxide + water + ATP