Also if buying a used diesel, be skeptical of:
2001 to beginning of model year 2004 GM/Chevy Duramaxes. Engine RPO code LB7
They have injector issues. Very costly. I just spoke to a guy in Nebraska (when on vacation) that was sold one. He had to put in 6 injectors right off the bat. Those are over 300 a piece and the top end has to be taken apart as the injectors are inside the valve covers.
2004.5 and 2005 GM/Chevy Duramaxes. Engine RPO code LLY
They have overheat issues and head gasket issues. A blown head gasket's price tag at the dealership is 4000.00 to 5000.00. It is 600 to a grand and a week's worth of work to do it yourself. I cured my overheating issue with an extra radiator and larger trans cooler, plus a GM installed '06 airbox and other changes. We got the truck for $10,000 of sticker so I am OK with my fixes, but I am making sure I don't do anything to blow the HG's. Unfortunately, due to a design issue that was subsequently changed, it is probably inevitable.
The best years (in my opinion) as far as used Duramax diesels is 06/07 engine code LBZ. They have the least pollution control devices and had the fixes that GM learned from the prior 2 generations on them.
Ford diesels have had their growing pains also.
GM trucks, whether gas or diesel, have an issue with brake lines, especially in the rust belt states. There are a couple metal clips that they used that start a point of corrosion. Now brake lines can be considered normal maintenance, but people just have to be aware that there are issues that can hasten the problems.
Ours blew in the driveway with the trailer attached. Needless to say camping was ruined that weekend. Our truck was undercoated when new and touched up annually. The blow out/rot out happened right at the location of the metal clip. 2 dissimilar metals, in the presence of salt caused the reaction and hastened the rust.
We put stainless steel lines in our truck, but also be aware, that if the front brake lines of a GM pickup with ABS are replaced, the brakes will need to be bled at a dealership as it takes a GM Tech2 tool to cycle the ABS valves to get the air out.
Now why do I bend your ear with all this ? Vehicles are getting more and more complicated. What is such a nice feature when they are new can turn out to be a tremendous headache money drain 1 or 2 owners down the road.
Do your homework, use the internet. Google is your friend. Try and get a used vehicle with a warranty. If you live in the rust zone, spend a little more and buy a truck from down south. Talk to people that have had their truck a long time or are the 2nd / 3rd owners. Folks that have the wherewithal to keep trading vehicles tend to not experience the issues that tend to crop up with age. Folks from down south/out west don't experience what happens to trucks that come from the north east.