Look at the fuel pump. Diesel fuel pumps are typically labeled with a "diesel" symbol. The nozzle on a diesel fuel pump is also larger than the nozzle on a gas fuel pump.
Check the owner's manual. The owner's manual of your vehicle will specify whether it takes gas or diesel fuel.
Smell the fuel. Diesel fuel has a distinctive smell that is different from the smell of gas.
Ask the previous owner. If you are buying a used car, ask the previous owner what type of fuel the vehicle takes.