You should remove the glazing first. We removed the beading, then heat the glass. While the glue is hot, we carefully remove the glass. This helps minimize glass breakage and makes for a cleaner installation. Then we use cardboard and rags to pry the old frame out. If you place something to distribute the force, you will not mess up the drywall on the inside. You have to jerk it to pop the nail fins loose if you are replacing the original windows because they normally always have nail fins. It takes practice to get it out without damaging trim and drywall.
It depends on what kind of window you have and what are the surroundings? Is there brick on the exterior, stucco, vinyl, wood, fiber cement or other materials? Also, it will depend on the material of the window frame itself, most times it will be made of wood but not always the case. On newer windows, the window will typically be screwed to the framing around the window with at least 4 screws. If you can find these screws, you can simply unscrew, cut the caulking away and remove the window (after removing the window trim first if your removing the window from the inside). Sometimes you will need to use a reciprocating saw to remove older window frames. I would consult with a local window expert before taking on any major projects first.