You can cut it out with a sawzall.
Depending on the type of window you are putting in, you can frame it with pt lumber or, if it is a concrete or stone foundation, you can cement the window in place.
I used to put them in basements in the neighborhood where I lived. Rip out all the rotted wood, mix up some mortar and set the metal or vinyl framed window in place, put mortar all around it. . Made a nice buck doing it.