We're coastal sailors and do no long offshore cruising. Still, garbage is a finite storage problem, just like tankage. If a boat's lockers are stuffed full when you cast off for a few weeks of even coastal sailing, your trash 'tankage' is undersized.
Removing as much future trash before it goes onboard (like many have mentioned), is first. Then it's important for us to recycle, compress, sort as much as possible to reduce volume. That leaves (in our case) a smaller volume of organic material in small bags.
It's surprising how fast garbage builds up on a coastal sailboat. We don't throw a lot of organic material overboard with shoreside disposal more readily available.
In our case, we end up storing recyclables and small bags of organic waste, in cockpit lockers. Our old boat has huge storage in these lockers.
The simple system we use to stow the above are tall kitchen waste bins. The are self stowing nesting inside each other. No garbage = 1 empty bin.
Once we're out a day or so, we end up with two bins; one holds small bags of organics, the other recyclables.
Then it's usually recyclables that tops a bin, and we un-nest another bin and begin filling that. At this point, we have just 3 bins permenantly onboard. With plans to be off longer in the future, I'll add a couple more to the nest which takes up no extra space, when nested.
But this system only works if you have the volume to start with. I see trash as a tankage issue on our boat. The longer we can stay out on our tankage, the better.