Organic carbon compounds record key aspects of the processes of their formation and mechanisms of preservation and are foci for research into the nature of life on the early Earth and the search for life beyond Earth. Prime in this respect are lipids preserved in sediments and sedimentary rocks that reveal much about the evolutionary trajectory of life on our planet. Lipids, predominantly derived from photoautotrophic microbes, dominate hydrocarbon records in the Precambrian. The rise to prominence of the Metazoa in the late Neoproterozoic, metaphytes in the Paleozoic, and modern plankton in the Mesozoic, can also be seen in the occurrences of distinctive molecular fossils. Organic matter of all types is optimally preserved in environments and sediments where radiation (solar and ionizing) and oxygen are excluded. In the marine realm, anoxic water bodies will often become sulfidic (euxinic) due to the activity of sulfate-reducing bacteria. Phototropic sulfur bacteria thrive in such environments, and the presence of their characteristic carotenoid pigments goes hand-in-hand with the enhanced preservation of all organic matter, driven by the reducing power of sulfide. The deleterious effects of radiation and oxygen on the preservation of organic matter are amply demonstrated by the results of ongoing searches for carbon compounds on the surface of Mars. The production of highly oxidizing substances through radical chemistry operating in the Martian atmosphere has resulted in environmental conditions that virtually assure destruction of much of the organic matter produced in situ or carried there on meteorites and interplanetary dust particles.