The era of diesels has lasted from the 1950's until today, as they are cheaper to maintain and more reliable than steam locomotives.
There are two main types of diesel locomotives, diesel electrics and diesel hydraulics. In diesel electric locomotives, the diesel engine generates electricity to power electric motors which move the locomotive, and in diesel hydraulic locomotives the diesel engine is mechanically connected to the drive wheels. The latter solution prevented electric motors from burning out, but fell out of favor in its niche of pulling loads up hills as electric motor technology improved and was easier to maintain.