1. Go to a store and ask to handle as many 9 mm as possible. Eliminate the ones your hand doesn’t like.
2. If possible, find a range with rentals and try the remaining candidates from p.1. Eliminate the ones that do not feel right in live fire.
3. Shop around: EE, retail, etc. Keep in mind the cost and availability of extra mags, holsters, possible upgrades, AND how much $$$ it will cost to buy and resell if/when you decide to change the kit. E.g. a good second hand Glock or CZ Shadow SP01 likely won’t cost you much on the flow through, but a brand new marvel of Turkish engineering purchased at full retail could result in a bigger write off.
A couple of caveats: new shooters often choose something with a skinny grip that is easy to hold like a hammer. When the gun cycles, you’ll want more meat to hold on: stronger grip = better recoil management = faster times, easier to stay on target. If you are new to this, find an instructor/mentor, this will help you avoid many pitfalls.
CZ Shadow 1 is pretty forgiving and very reliable. The grips can be swapped to make it fit your hand better. Same goes for CZ 75. Shadow 2 is awesome, but it is too heavy for IDPA.
Glocks are harder to master in my opinion: stock trigger is quite gross out of the box, and if you are not gripping it right, there may be reliability issues (“Glock limp wrist”).
Sig P320 family is a good option.
Sig P226 and variants are good combat/duty arms, but they suck for sport.
M&P tried once at the range, didn’t like it at all.
CZ P10 variants, people like them, I have no personal experience with them yet.
The above is highly subjective, because everyone’s hands are different.
As said above, don’t worry much about the price difference as the ammo cost will soon eclipse the initial $$$. But avoid exotics and stuff with bad resale values.