Ask your dealer, if you're buying it used from one you trust.
If you're buying from a dealer you trust (who is also a gunsmith) that can really, really help. Doesn't always apply to internet sales, but when I bought my first pistol it was a used gun - a S&W 4040PD .40 Generation III pistol, pretty rare, scandium frame and a single-stack magazine. It was a former LEO gun and showed some holster wear to the bluing on the slide but mechanically it felt tight, it felt good, it looked great inside and down the barrel.
I bought from a local dealer who is a gunsmith and has a large PD clientele (and a large local clientele period). He checked the gun over thoroughly and told me: "It's got some holster wear, but it's in great shape. This was a police backup gun. If you have any trouble, bring it back, but you won't."
He was right. So paying a little more (probably 5% over what I saw a little later for a similar gun) to my local guy was a good move for a newbie. It helps when you find a local dealer you can really trust, who cares about his customers because they're the guys he hunts with and also many of them are police in his town.
Obviously the operative word here is *trust* and sometimes you don't/can't have that, but this man is a well-regarded dealer in my area. When I picked up my license I asked the officer who handed it to me who he recommended as a dealer and a pistolsmith, and he didn't steer me wrong.

+1 to other people's advice too.