Ideally, remove all the caulking. All of it. Clean w 50/50 bleach/water. And do it over. And be thorough . Sashco Lexel White adhesive caulk. mold resistant, sticks around a long time, works on wet surfaces. It isn’t cheap tho. 20-25 bucks for a 10oz tube. If that’s too costly, GE Supreme Silicone is a good product but you absolutely have to get the old caulking out first. That’s about ten buck USD a tube.
If you can’t remove it all…. Remove all old loose caulking. Clean up caulking with a 50/50 bleach/water mixture. Let dry well.Then go back with what was there - silicone or adhesive caulk, etc. Large gaps need something like backer rod to fill the majority of the void. Is it a tiled shower stall or is it paneled? Is the gap at the tub/panel joint? Where is the gap worst at? Fill the tub w water halfway, then do the work. Preloading the tub with some weight helps a bit with the tub/panel joint cracking.
Fixing mold can potentially be stupid expensive, but my experience is in commercial settings, not residential. Leaking around the tub can mean up to and including ripping out tub, greenboard, and exposing the studs to either replace or treat them. It likely won’t need to go that far.
Leave door open when not in restroom. Install a fart fan.