How does this comet have alcohol in it?
Getting atoms together into molecules requires two basic things - getting the reactants together and them providing the means to overcome the "activation energy" that is due to the mutual repulsion of the electrons that surround them.

Astrophysical chemistry is a rich and complex field of study. Most molecules are produced by a wide variety of processes. For ethanol in solar system objects, a cartoon of the process might be this:

Grains of dust (basic silicates and soot) form in the protosolar nebula; cosmic rays and high energy radiation from the protosun ionise atoms (remove outer electrons), which makes them "sticky"; these ionised atoms are concentrated onto the surfaces of dust grains, increasing their densities to the extent that reactions between them become likely; hydrogen ions are able to hydrogenate carbon and oxygen to produce CH and OH radicals; these then encounter each other in the presence of more hydrogen to form ethanol; dust grains with ethanol are then incorporated into solar system bodies like comets.

But as I said, for any individual ethanol molecule, other pathways are possible.