Measure the basement window opening with the old window still in place, taking height and width measurements. Measure from the furthest points out, where the window casing meets the block perimeter.
Order the replacement window with those measurements. Leave the old window in place until the new one arrives.
Pry the trim perimeter from the inside edge of the opening, using your hammer and prybar. Don’t break the trim as you remove it. Set it aside. Pull the window unit straight into the room. There should be a second perimeter of trim around the outer edge of the opening; leave it in place. Although it’s a block wall, there will be a wood frame around the inside of it. Leave the frame in place.
Set the new window unit into the opening. Set a level on it. Push wood shims under and alongside the unit until it’s level.
Shoot mounting screws outward through the casing and into the wood frame that’s along the inside of the block opening to secure the window.
Spray foam insulation around the perimeter of the window, into the shimmed space between the casing and the frame.
Reinstall the trim that you took off, using your trim nailer, covering the shimmed and insulated space. Caulk the perimeter of the window unit.