your looking at a 6.5 TD, in general not a bad engine, but prone to head gasket issues and injection pump problems.
Look for a 2500 most of those will be non EGR and no catalytic converter ( the 1500s will have them ) in the diesels. ( look at the VIN, 8th digit will be an "S" for EGR/CAT and "F" for non, look for an "F" engine.
The newer you can find with the 6.5, the better off you are, as they will have a 120k, 11yr warranty on the injection pump, the engines are 5yr 100k. so most all engines are out of warranty now.
Truthfully, you'd be better off looking for a Dmax, 'Stroke, or CTD, the 6.5 wasn't a power house by any means.
you are looking at $1600 for a new injection pump plus install( 5 hours), and around $9500 for a 6.5 crate engine if you need to go that direction after purchase.
check oil cooler lines for leakage at crimps (driver side of engine/rad) and the cooling system for bubbles/ coolant level.
Kevin