Gaps larger than 10mm between the window frame and the wall should be filled using expanding foam. Caulk won’t work for these bigger gaps because it tends to crack, bringing you right back to where you started.
The expanding foam will seal any crevices between the wall sill and the window. And, once it’s set, you can trim any excess.