When buying a used musical instrument there are three things you should keep in mind:
1. Who and Where
A good factor to determine an instruments' condition is to know who previously owned it. If you're buying it from a garage sale, then you might be able to meet the owner and ask him why he/she is selling it, how long it was used, etc. If you're buying it from an online shop, make sure they have a good customer satisfaction rating or better, a return policy. If you're buying it from a music store, ask the salesperson if it's possible to know the name of its previous owner, how long it's been in the store, etc.
2. Overall Condition
If possible, ask someone who knows a lot about music instruments to accompany you. Maybe you have a friend who plays the instrument you want to learn or a music teacher in your area who's willing to help you. They can help assess whether the instrument is in good condition by playing it, listening to how it sounds and how it feels while they're playing it.
3. Value for your Money
Make sure that the money you're paying for the used instrument is worth it. Research first how much the instrument costs if it's brand new; go to different shops, compare prices, compare the condition of the used instruments and assess whether it's truly a good deal.