For starters, you need to know what you're going to use it for. Target shooting or self-defense... or both? That helps narrow it down a bit.
You need to decide on what caliber you want it chambered in. The big three, most popular choices are the 9mm, .40 S&W, and .45 ACP. They are all great cartridges.
I prefer the 9mm. It has the least recoil and is the smallest, meaning quicker follow-up shots and more rounds a magazine can hold. It has plenty of stopping power to take down a human size target, especially with hollow point and +P (high pressure) loads.
The .40 S&W has marginally greater muzzle energy than the 9mm, but better stopping power due to the larger bullet diameter. It is the best of the three rounds for long distance shooting, as it retains its energy well over distances, for a pistol cartridge. It has significantly increased recoil over the 9mm and magazines usually hold fewer rounds, but everything is a compromise for a bonus in another area.
The .45 ACP is often known as the "man-stopper". It has significantly greater muzzle energy and a much larger diameter bullet than either of the other two rounds. It also has the most recoil and .45 magazines usually hold fewer rounds than the other two. Hollow point .45 rounds are devastating at close range, but follow-up shots are somewhat slower than with the others and you have fewer shots.
Now for the gun itself. I prefer a full-size handgun. That's what I recommend you get unless you have small hands or plan on carrying the gun concealed (if you have the appropriate license). There are many good guns out there, but my top three choices would be-
(In order of preference)
-Springfield XD 4" service model (9mm)
-Glock 17 (the 17 is the 9mm, other calibers are available)
-Beretta 92FS or M9, basically the same gun (9mm, also there is a .40 S&W model, no .45)
Smith and Wesson, Ruger, and many other companies also make fine guns. These are just my top three. I like the XD because it has the most and best safety features of any pistol on the market. It is accurate and very reliable, and fairly comfortable. The Glock 17 is the most reliable, but I don't think it is a comfortable gun - your mileage may vary. The Glock has very good safety features. The Beretta is hands-down the most comfortable and ergonomic, but with the fewest safety features of the three. Also a very reliable and accurate gun.
I recommend you go to a gun store and look at these three, along with other handguns. Shoot them if you can before buying. Good luck!