Gasoline fuels most light-duty vehicles, such as passenger cars and pickup trucks. Heavy-duty vehicles, like buses, delivery trucks, and long-haul tractor-trailers, typically run on diesel.
Both fuel types are needed because gasoline and diesel engines have different strengths. As my automotive engineering students learn, this makes them suitable for different uses.