Pre-Purchase Inspections

I’ve had the “always get a pre-purchase inspection before buying a used car” pounded into my head from Zach and Ray’s videos as well as Deal School but was wondering how someone actually does that depending on where you’re buying from.

For instance, if I’m buying from a used car lot would I take it to a dealership or an independent mechanic? Is there an advantage to one over the other?

Or, if I’m buying from a dealer, would I still get an inspection? If yes, who would inspect the car? Another dealership? An independent mechanic?

I definitely see the value in having a good idea of what you’re getting yourself into but, at the risk of sounding stupid, what/where are the nuts and bolts of actually getting that done?

Basically, explain like I’m five. lol

Thanks!