When cells use fat for energy, fatty acids are broken down into molecules of acetyl CoA through a process called beta-oxidation. This process occurs in the mitochondria, the site of cellular respiration. If oxygen is present, acetyl CoA enters the citric acid cycle, also known as the Krebs cycle, where it is fully oxidized to CO2, producing a total of 12 NADH and 2 FADH2.
NADH and FADH2 then transfer their electrons to the electron transport chain where they produce ATP. Each NADH generates 3 ATP and each FADH2 generates 2 ATP, thus:
12 NADH x 3 ATP/NADH = 36 ATP
2 FADH2 x 2 ATP/FADH2 = 4 ATP
Therefore, one molecule of acetyl CoA can produce a total of 40 ATP if oxygen is present.