Before purchasing a pannier rack you will need to check that your frame has the correct mounting points. You’ll find these on the frame just above where the rear wheel attaches. Most frames will have a threaded hole in them, but some older frames may just have holes that you’ll need to use a standard nut and bolt with.
You’ll also need to check you’re wheel size, which you can find on the side of your tyre. A lot of racks are universal in size, but some are size specific and you’ll need to get the right one. Also, check for fixing points for the top of the rack which should be located on the frame, just below were the seat post inserts into the frame. There’ll usually be two bolts screwed into the frame but, if you don’t have them, it doesn’t necessarily matter as most racks come with bands to wrap around the frame instead.
One final thing to check is the kind of brakes you have. If you have disc brakes on your bike, you may need to buy a slightly different rack to take this into account.