If you are buying high end wheels, some of them cannot be fitted with brakes at all or can only be fitted with disk brakes. If it's a fairly good quality wheel, make sure it has has been "machined" for brake pads (or just look at the photos, if it's a coloured wheel with a shiny silver strip where the brake pads go then it has probably been machined).
Also, some wheels are for bikes with only one gear and you won't be able to fit your gears onto them, or perhaps it will not accept as many gears as your bike has. Count the number of sprockets/wheels on your rear wheel and see how many gears can be fitted to the new rear wheel. Definitely avoid "track" or "fixie" or "single speed" wheels.
Different frames do have different widths for the rear wheel, but you can usually get spacers to make it fit if the wheel is designed for a narrower frame than your bike.
Aside from that, be careful what you buy! Good quality wheels are very expensive (you can pay more for one wheel than you paid for the whole bike) and some wheels are not very strong, or have terrible bearings, or are ridiculously heavy.
You should consider just buying a new rim, and having a bike shop fit the new rim to your existing hub/spokes. My local bike shop will only charge 50 bucks to do that. If your wheel is in good condition, you might struggle to find one that is the same quality without spending too much money. Trek is able to place huge orders so they get their parts much cheaper than you can.
Adjusting your brakes is no problem. You just loosen the bolt that holds the cable on the calliper, pull it until they are in the right position for the new size rims, then tighten the bolt. Then you have to adjust the angle and position of the pads, since they will also be wrong - again just loosen the bolt holding the pads on, move them into the correct position, then tighten the bolt.
Your brake pads will work better if they are adjusted exactly right, but I think exactly how to brake pads should be positioned is better asked as a separate question (no doubt it has already been answered many times). You don't have to get them perfectly right, but it's worth reading up on.