I've made some great buys on used vehicles, I think... My best advice is to figure out what you want and be patient, you'll find a good deal.
Engines last longer than transmissions and the rest of the drivetrain. Transmissions ($3500ish) and transfer cases ($2000ish) are not cheap, so look for pickups with new/rebuilt. Where the vehicles "life" was spent prior to purchase can dictate how much the 4WD was used. A pickup in Texas vs Colorado for instance would be vastly different. Flat ground no snow, vs the opposite. Running around in automatic or 4-hi up and down the highway for months at a time isn't good for longevity. Front diffs are also spendy, but not as bad as the transfer case/tranny.
Look for vehicles that have been well maintained, its pretty easy to see it, pop the hood, look at the seals, ask questions on maintenance, etc.
Ask how much its been used to tow.
I wouldn't touch a rebuilt title, but thats me. I've seen some great deals, but I just couldn't do it.
Lots of little things start to go out or need to be maintained around 80-120k. Alternators, starters, water pumps, U-joints, breaks, front hubs/bearings, fluids, etc, etc. You might get a "deal" and have to drop a lot of money into it make it reliable.
How many miles is too much? Depends IMO, but I wouldn't buy a used vehicle with more than 60-80k on it tops, unless you don't plan on driving it much, and/or its short term "investment." The potential for added costs start to eat up the savings.
I can't justify owning a diesel. The added up front costs, maintenance costs, etc just don't pencile out for me. I don't pull heavy trailers, and can't see owning a vehicle longer than 150k (10-12 years). The motor may lost longer but the rest of the components have a similar life span as a gasser and are far more expense. For a daily driver, it makes zero sense for me. The newer gassers get better mileage as well.