The whole window frame is rotten and needs to be replaced it is in the bathroom might look at replacing with a aluminium window depending on price
Partner with Builderscrack