Your first guitar could probably be the most important factor that will determine your progress with the instrument. If you are a complete beginner buying your first guitar, it would be a good idea to bring along someone who can already play so he/she can assist you in trying out the instrument. The most important thing to look into is the playability of the instrument; it needs to be comfortable enough for you to play.
Some guitars comes out from the factory with a high 'action' (the height distance between the strings and the guitar fret board) setup simply because some factories agree that it's easier to lower the action than to raise it. If the action is to high than the harder it is to press the strings to produce a sound (this will surely be a discouraging factor) while a too low actionsetup though this rarely the case, will produce a buzzing sound.
In conclusion, make sure to choose a guitar that has a reasonable action setup. If you're buying an electric guitar, you might want to ask the music store technician (if any) to setup the guitar for you. A good playable guitar will encourage you to keep learning and before you know it you'll be strumming along to your favorite songs.
Other things to consider:
*Price - Guitar with a higher price tag are normally better in quality and this is probably the only way to judge a guitar when buying them online (without being able to test them first) but if you are just starting out, the cheaper ones will do just fine.
*Type of music you intend to play - certain kind of music like classical guitar music sounds best on a nylon string guitar so unless this is the type of music that you intend to concentrate on, a steel string guitar would be a safe choice.