If you have income, and a good credit score, then the best bet would be to either apply for a 0% intro-interest period CC (if this is the type of debt you're referring too) or a personal loan from a credit union or your bank.
Your strategy about "paying it off over the longest period of time for the smallest amount of money" does not work here. Most interest free periods don't extend beyond 18% or so, and there are no personal loans that will not immediately charge you interest.
So if it is CC debt with the caveats I mentioned, go to a card like Chase Slate or similar, and if it's cash you need, a personal loan or HELOC are your only options.
If you have shit credit, you need to sell things or you will pay out the ass for a payday loan.