Before removing a window, it should be measured and a replacement ordered. When the replacement arrives the old window is removed and the new one installed. If just the glass is damaged it can be less work to just replace the glass.
To remove an old, small window, the trim around the window must be removed. If the window is new enough, it will be held in with a series of screws or nails that are removed and the window is then pulled out. The window may have caulk or foam insulation holding it in that can be cut with an Exacto knife or box cutter. The new window is then placed in the opening and shimmed for a tight fit.
Replacement windows have a series of screw points to attach it to the existing window frame. A cordless electric drill is usually used. Very hard wood may require pre-drilling holes into the wood so that the screws go in more easily. When the window is in place any gaps around the window frame are sealed using caulk or foam insulation. Once the sealant is cured, new trim can be put around the window. If sealant is over applied, it is sometimes necessary to trim excess foam or caulk for a flush trim installation.