Thanks for the reply. But what if I didn't want to remove anything. What are my options so that I can seal up any interior gaps and then paint the window?If you want to paint it, you cannot use your standard silicones and silicone is not usually the preferred sealant of most window installers.
On the interior side of things, your requirements are less arduous because it should not be exposed to weather or as much of the UV degradation.
That caulking job there is a bit of a hot mess.
You are going to spend a decent amount of time cleaning that off and if you are keeping those wood jambs, probably better suited to just rip off those old stops and try to clean the window.
If you are painting it white, I would just pull off that old interior stop and install a large enough one to cover the old caulking and paint it. Seal any gaps prior to installing the stop with caulking and/or combination of foam.
I'm not concerned with the exterior because I plan to get a pro to properly re-caulk them in a couple of months.