The best way to rebuild a team (but not necessarily the best way to run a baseball team) would be to tear down the team once it is clear that reaching the World Series is a likely impossibility, when you have to trade away talent in order to get the payroll into shape. Much like how the A's have been run since Charlie O. Finley, heck, all the way back to Connie Mack, the best way to rebuild is to trade away all the players of value to get prospects back who can be good in a few years or less (the Marlins would make Connie and Charlie O. proud)
Meanwhile, as I noted about the draft, the best draft picks in terms of efficient gathering up talent for your re-building team is to ensure that your team is among the Top 5 picks overall, or better yet, the one with the top pick overall. So your team has to stink, pretty much on purpose, and get you those top picks. That apparently is the strategy that they Rays did for all these years, building up a lot of talent in their farm system that is paying off now, and the Marlins have been basically following that strategy during its short life in the majors.
That is the apparent strategy that Bobby Cox used when he was GM of the Braves, before he picked up the pieces he thought he could win with, at which point he took over as manager. It was examining his tactics, tied to my memories of the A's (Connie and Charlie) that led me to this strategy.
Then as your top prospects start coming up and sprinkling your major leaguer roster, you sign key veteran free agents to fill spots where you don't have any good prospect coming up, in order to not block them should they grow and develop, plus pass on their veteran savvy to their young charges. The Giants have done this, first with Matt Morris mentoring Cainer, then later when Randy Johnson mentored Tim Lincecum, Matt Cain, and Jonathan Sanchez. They also did that with Bengie Molina mentoring Buster Posey.
A couple of good hits while competing for the playoffs (by drafting prospects that should have been drafted earlier but dropped due to some reason and/or finding a starter via international free agency, like Braves picking up Andruw Jones) will help keep the good times rolling longer than expected.