all pots have their values embossed somwhere into them. if you don't want to change the way the controls react in your guitar, get one that's the same value and just switch them out. That's a bit of a simplification but that's really all there is to it.
I'm a dude, he's a dude, she's a dude, we're all dudes HEY!
they're not one size fits all, there are some that are taller and shorter and there are also linear and tapered which means that when turned they will increase or decrease the tone/volume at different rates
First you need to see if your guitar uses metric or imperial pots (often called 'import' and 'US' respectively; though this naming can be confusing as most MIJ guitars use the 'US'/imperial size as well). then you need to work out if your guitar uses long shaft or short shaft pots.

Then you need to decide what value and taper to use. 250k is common for guitars with single coil pickups and 500k is common for ones which use humbuckers, though 300k, 50k and 1meg are also sometimes used and active pickups use 25k.
As for taper, that's just personal choice. Linear means the pot works in the most straight-forward manner; 5 on your control will be 50% volume technically, but because of the way human hearing works it may sound like the guitar is at 80% volume or so. Logarithmic sweeps unevenly, to better match human hearing. '5' on your control won't actually represent 50% electronically, but it will isound like the volume is at half. So linear = technically accuate, sounds uneven and log = technically uneven, sounds accurate.

Then there's solid and split shaft. This depends on what knob you use.

If you open your guitar up and can see what is written on the current pot (or better yet, post a clear photo of it here) then it'll be easy to work out what you need to buy as a direct replacement.
Yes, I know everything. No, I can't play worth a damn.
A child is trafficked and sold for sex slavery every 30 seconds. Support Love146.
Not all pots have the value stamped on them. The last batch of CTS pots I got have nothing on them. I had to test them with a multimeter to figure out which was 250 and which was 500.
Another thing to note is that pots have different diameters. I can't tell you how many pots I have sitting around because the shafts are too fat, and I'm not about to go drilling bigger holes in all of my guitars. -_-

A mini rant - pots are very difficult for me to buy, because there's often a total lack of dimensions. I really, really hope that dimensions get standardized one day, or at the very least that dimensions are listed when I'm looking at pots. Not to mention that a lot of pots don't even say if they're "A" or "B" pots.

Spin 'round carousel when your horse isn't screwed in.

My band:
Fractured Instinct
(For fans of Death/Groove/Prog Metal)

Ibanez RGA42E
Ibanez S420
LTD H-301
Ibanez RG520
Peavey Predator USA
Douglas Grendel 725
Line 6 Pod HD500X