You will need to know the distance between the forks, ie, 100mm or whatever it is for the front wheel,
and the same internal measurement for the frame the back wheel fits into, ie, 135mm or whatever it is
in your case.
You need to also ensure your new back wheel comes with the right hub
to take the cassette off your old wheel,
not alone will it need to have the same amount of gears, it will also need to be either
Shimano or SRAM compatible if your old wheel uses either of these cassettes,
Shimano and sram are interchangeable, as long as they are the same speed cassettes.
There are other types of hubs on wheels, not just Shimano and sram
all wheels will be advertised as being available In a range of hub types,
so you need to get a wheel that will take the make of cartridge you plan to use,
and that cartridge will also need to be of the correct speed, ie, 8, 9,10 or 11 speed,
which you will determine by counting the gears on the old wheel.
Also note that you need to get wheels that suit your braking setup, so they will
be either rim brake or disc brake, get the type your bike is set up for.
Wheel width too is important, get the same width rims as is on your bike,
wider ones will make your tire a little wider, and unless there is enough room
between the frame or fork then the tires will catch, and you won’t be going far.
Rims usually cone in 13, 15, 17, 19 mm internal diameters, and others, so make
sure you replace like with like unless you are sure you have room to go wider.
You know more spokes makes for a more durable wheel all else being equal,
weight will go up a bit, so you need to take all this into account and chose
what suits the type of riding / terrain you will be riding on.
If you post the model and year of the bike, it may help suss out what rims
came on it originally, if no one changed them.