When buying a used guitar to learn how to play guitar on, you should also check the intonation which is the accuracy of each individual note that the guitar can produce on any string. If it is correct then every note on the guitar will be the correct pitch. If it is not correct then the entire guitar will be impossible to tune and will sound really really bad. A good way to check the intonation quickly is to play the E shaped barre chord on each fret of the guitar moving it toward the bridge and checking that it does not lose its pitch.
If you are looking at an electric guitar you need to plug it in and see how well it works through an amp. You should turn the amp up to a fair volume level and play with the volume and tone controls by turning them to full and then back to zero. Test the pickup selector by flipping the switch back and forth and carefully listen for any noises coming through the amp while doing these things. Scratchy sounds or clicks may indicate worn out electronics in the guitar. After testing the sound of the guitar you can go to a guitar shop and ask to play a new model of that guitar. Play it through a similar amp and see if you notice any differences in sound. If you don’t like the sound of the used guitar don’t buy it.
Make sure when shopping for a guitar that you don’t shop impulsively buying the first thing that catches your eye. It is a major purchase and you want to choose the right one so make sure you leave some time and go away and think about the purchase before you actually buy the guitar. If in doubt you are probably better to wait and see if you find something else you like better. Never rush into buying a used guitar because usually you cannot return the guitar once you have purchased it. Simply wait until you find the one you want for sure and then you can purchase it. In the meantime you might could borrow an old guitar form a friend that you can start to learn how to play guitar on.
You could always find an experienced guitarist friend or teacher that would not mind going with you and helping you make a more informed decision. Most musicians love to help out beginners or newbies. Good luck on finding a used guitar that is exactly what you are looking for!