You could cut a piece of wood the same size & install it
Usually they say you need to remove all rotten wood
This can be tricky around a window - if you hit the window it can shatter
I would dig out as much as I can, prime & paint what is there
Then cut a piece that will fit
Apply caulk/adhesive & insert piece
Let set, then prime & paint
The only problem may be matching the existing color