To produce petroleum-based ultra-low sulfur diesel (ULSD), sulfur is removed during the oil refining process. Hydrotreating is a commercially proven desulfurization technology. In this process, a heated mixture of petroleum feedstock and hydrogen is passed through a reactor containing catalysts (compounds that facilitate a chemical reaction but are not consumed by it) to separate sulfur from hydrocarbon molecules or remove molecules that contain sulfur.
To learn more about hydrotreating and ULSD production technologies in general, see the Energy Information Administration's The Transition to Ultra-Low-Sulfur Diesel Fuel: Effects on Prices and Supply: Desulfurization Technology.
Alternative ULSD production technologies are emerging, including sulfur adsorption, biodesulfurization, and sulfur oxidation. See the Energy Information Administration's Developing Technologies and Ultra-Low-Sulfur Alternatives for more information.
Also see the AFDC's Biodiesel, Biomass-to-Liquids, Coal to Liquids, Gas to Liquids, and Hydrogenation-Derived Renewable Diesel pages to learn how these inherently ultra-low sulfur fuels are produced.