A diesel engine is a type of internal combustion heat engine, powered by diesel. These engines run small electric generators called diesel generators, often in remote areas as well as the engines of cars and trucks (both large and small).
Diesel engines ignite their fuel through compression. Temperature of gas molecules rise when the volume decreases because of the ideal gas law (unless the gas is cooled at the same time). Diesel engines rely on this. A piston compresses the air in the cylinder (see figure 1), making it extremely hot. The diesel is then atomized in the injectors, and a mist is sprayed into the hot air. The hot air immediately ignites the fuel, providing ignition.
When cold, diesel engines use a heated piece of metal called a glow-plug to help ignite the diesel.
Starting a diesel engine is harder than starting a gasoline engine because of how diesel engines ignite their fuel. The diesel starter motor must be strong enough to compress the gas inside the cylinders, igniting the diesel and air mixture. This requires higher power draw than a traditional, spark-ignited engine, so diesel engines have more robust batteries.
The block is the backbone of the engine. It is a large block of metal, usually aluminum or steel, with holes cut into it for the cylinders.
The cylinders of an engine are where the work is done. Fuel is injected into the cylinders, where it is ignited by squeezing the diesel and air together making an explosion. This explosion moves the pistons, doing work, allowing the vehicle to move forward.
Pistons are devices that slide up and down inside the cylinders. Their job is to slide in and out, connected to the crankshaft, in order to compress the air injected to the chamber—this causes the air to heat up. The volume of air that enters the chamber is compressed about 14-25 times its original volume. 
A camshaft is a device that manages the timing of the engine. A camshaft's job is to regulate when fuel is let into the engine, and when exhaust is let out. This seemingly simple job can have a great effect on the performance of the engine.
The purpose of a fuel injector is to atomize the fuel. This means to turn the liquid fuel into a mist, which drastically increases its surface area. This allows the fuel to combust more quickly, giving greater impulse to the piston. Fuel injectors are an improvement over carburetors because they are lower maintenance, and atomize the fuel better. Fuel injection allows for higher engine efficiency, which can lead to more power, and better gas mileage.
The crankshaft is the most important part of the engine because it connects the parts together, and allows the engine to create power. Its purpose is to turn the linear (up and down) motion of the pistons into rotational motion. One end of the crankshaft is attached to the camshaft, via a timing belt. The other end is connected to the flywheel, which regulates the power coming out of the engine, sort of like a surge protector for your computer.
This is one of the biggest differences between a diesel engine and a gasoline one. Because diesel engines ignite their fuel through compression, the starter motor must be able to cause that compression, so the engine will begin to move. This means the battery on a diesel-engined car must be more powerful than the one on a gasoline-engined car.