My boat smelled dreadful when I bought it. First thing I did, after reading Peggy’s book, was to replace the old permeated vinyl hoses and give the entire bilge a thorough cleaning. Also got rid of the prohibited (on the Great Lakes) overboard pump out hose, y-valve & through hull, and replaced leaking scupper hoses.
Since then, it‘s just regular bilge cleaning in the fall as part of winterization and generally once mid-season, plus routine complete draining and drying of the bilge during sailing season whenever I close up the boat. It might sound obsessive to some, but I actually remove the last bit of water, mostly backflow from the bilge pump hose, with an oven baster. A clean & dry bilge is key.
I try to keep humidity down in the cabin when the boat is closed up with about six H2Out desiccant dryers. They’re a bit pricey, but rechargeable - about three hours in the oven once a month. I switched to those after having one of those hanging Damp-Rid bags spring a leak and make an awful mess. I use a half dozen Damp-Rid buckets during winter storage.