This can be hard or it can be a fun adventure. If you have plenty of time, a large selection to choose from, and keep your wits about you, you can make a good choice. Here are my suggestions (what I do when I'm shopping for a guitar):

Try out as many guitars as you can find and pick the one that sounds the best. The sound quality of guitars varies quite a bit even between "identical" instruments. Also the 'feel' of the neck varies a lot, but that is always referenced to what you are used to (the instrument that has neck dimensions close to your old instrument usually 'feels' the best). If you are going from a 3/4 size to a full size, or you are going from a steel string or electric to a nylon stringed instrument, they will all feel 'chunky'. Sometimes the one that feels the least 'chunky' is likely to have a neck that is too slender and therefore weak. I always try to ignore the feel and concentrate on the sound. I have always been amazed at how quickly I can get used to the feel of an instrument that I previously thought was almost unplayable. Its a little more dificult when the scale length is diferent, but these days I switch between electric, 12-string and nylon stringed instruments several times during a single performance and don't even notice.

If possible, try playing the instrument while facing a bare wall, so that the sound of the instrument from the front is reflected back. The other alternative is to hear someone else play it while you sit in front of it. It doesn't have to be a skilled player, just someone who can play a few notes and chords cleanly. Play notes and chords very softly, and then very loud. Some guitars can be played both louder AND softer than others. I prefer the instruments that have this broader dynamic range. Play notes across the range of the instrument, from the lowest (open sixth string) to the highest note on the first string, and in between. Also on other strings at diferent frets. None of the strings should be louder than th others, and none of the notes should 'boom' at you. Most good classical guitars will have a slight resonance around the A or B on the fifth string, but that is generally not noticable to most peoples ears. Both of my Taylor 12-strings have a resonance around G ot G flat (the same place on the 5th string when tuned down 3 or 4 half-steps)

There should be no buzzes or rattles. Buzzing is usually caused by an uneven or warped neck, loose nut or bridge saddle. Rattles are usually loose internal braces or tuning machines (or a loose truss rod on a steel string guitar).

Avoid a guitar that has distortions or cracks in the top, back or sides. They always get worse with age. Although cracks can be repaired, the repair always changes the sound. It is generally a bad idea to repair a top on a classical guitar that otherwise sounds good. Guitars in the lower price ranges will generally have laminated (plywood) back and sides, so warps and cracks are unlikely. The top may or may not be solid wood. Go for the instruments with the solid tops, but you'll probably prefer the sound of a solid top instrument without looking anyway.

The guitar also needs to have good intonation. play each string at the twelfth fret and then the harmonic at the twelfth fret. They should sound the same. If not, either the bridge is positioned wrong or the string has uneven density along its length. On a nylon stringed instrument, if the difference between the 12th fret not and the 12th fret harmonic is not too great, there is a trick to adjust the string density.

Try playing notes of similar pitch on diferent strings (ie; the open 1st string, 2nd string at the 5th fret, 3rd string at the 9th fret) and make sure they are the same pitch.

At this point, if you have found a guitar that sounds good and is properly intonated, consider the looks. No blotches or checks in the finish (blotches are usually caused by glue that got on the wood before the finish was applied) and general appeal.

Don't hesitate to try an instrument outside your price range for reference purposes. A more expensive instrument can serve as an example of what you're ideally looking for, and a less expensive instrument can serve as a reference point as well. You also never know - the best guitar in a given price range (or the entire bunch) is often not the most expensive.

Good luck and try to enjoy the experience.