Yes you can fill that area with low expanding spray foam (it will say right on the can for windows and doors)
The sheetrock may need to be replaced and finished if it's missing below the window.
I'd prep the area around the window were any old paint lines were or unpainted areas show. Repair it, prime and paint.
I like to buy all the trim and prime and paint all of it before any cutting, that way you only have to touch up the nail holes and not have to do any cut in painting.
The stool (the part on the inside that's missing on your's, commonly called by the wrong name, a sill, the sill is the outside area at the bottom)
get's installed first. You can buy premade sills in several differant styles and depths. Some ladys like a wider sill so they can put there fofo stuff there.
If you buy the one with the ogee on the front of it you will have to make a few extra cuts to finish off the ends of it, if it's just round nose moulding it gets rounded off with a sander or router on the ends.
As deep as yours is your going to have to measure the depth from the sheetrock to the bottom of the window frame and add at least 1-1/2". With one that wide you may have to buy a reguler board and round off the front edge.
The stool has to be cut long enough to stick out past the casing (the trim that goes around the window frame) by about 1/2" on each side. I just use a scrap piece of the casing, hold it up on the jams (the wood your going to have to add around the window on the inside of the frame) mark the wall and add 1" and cut the stool that length. You take that piece and hold it up to the area it's going to go and mark your cut your going to have to make so it will fit tight to the window, measure the depth from the sheetrock to the bottom of the window frame, that's how deep to make your cut, mark the stool with a speed square and cut out that area with a jig saw. Test fit it.
If it fits it can be attached with long finish nails. If you nail it in the far corners and one in the middle most of the nails will be hidden.
Once that's in you have to install the jams. There going to have to ripped (cut along there length) the top piece goes in first then the sides, that way the sides will hold up the top piece. It must be flush with the sheetrock and the frame on the window.
Once there in all that's left is the casing, a simple way to figure out how long it needs to be to cut a 12" long piece and hold it up in the top corners and mark the wall, now you have a referace point to measure. Install the top piece first, when you install the sides the most important thing is to make sure that angle cut fits tight. I nail one in from the side and one in from the top then one in the face at the top. Now I can flex the piece of wood to get it even along the jam without changing the my joint. If it's to be painted set the nails and use painter puddy to fill the holes not caulking, caulking will shrink. Caulk all the areas with tiny gaps with 50 year warrenty Dap caulking with only a small hole in the tip of the tube, wipe with your fingle then wipe down the area with a damp sponge. you only need the caulking to be in the nail hole not all over the trim or wall where it will show later.