Acetaldehyde is produced during the conversion of pyruvic acid to ethanol when yeast ferment sugars [Link]. The converse is also true — acetaldehyde is produced in the liver as it metabolizes ingested ethanol (and may be the prime culprit in a "hangover").

Organic molecules with a carbonyl group (-C=O) between two hydrocarbon portions.

Ketones are synthesized in the liver, usually from fatty acids.

When glucose metabolism is suppressed, during starvation or in diabetics, fatty acids are used as a source of energy. But instead of entering the citric acid cycle, the acetyl-CoA produced from them is converted into the ketone acetoacetate. Some of this is then converted into acetone (which can be smelled on the breath of patients whose diabetes is out of control).