Catalyzes the penultimate step of the biosynthesis of cholesterol, the dehydrogenation of lathosterol into 7- dehydrocholesterol (7-DHC). Cholesterol is the major sterol component in mammalian membranes and a precursor for bile acid and steroid hormone synthesis (PubMed:10786622, PubMed:38297129). In addition to its essential role in cholesterol biosynthesis, it also indirectly regulates ferroptosis through the production of 7-DHC. By diverting the spread of damage caused by peroxyl radicals from the phospholipid components to its sterol nucleus, 7-DHC prevents this form of cell death (PubMed:38297129, PubMed:38297130). {ECO:0000269|PubMed:10786622, ECO:0000269|PubMed:38297129, ECO:0000269|PubMed:38297130}. This is the function of ENSG00000109929 (SC5D, sterol-C5-desaturase).