In case the question is about closing an open position as a retail trader:
Suppose this is a 3y swap, and the holder is paying fixed, receiving float. The fix leg is paying 10%, but the float index is now at 5%, so assuming the index is not expected to change in the future, the position is now significantly out of the money. The main exposure is to the difference between the float leg and the fix leg, because that's the point of a swap, as Freddy said. To back it out, we do either the reverse swap with a different counterparty (pay float, receive fixed) or call the original counterparty and ask for a price to tear up the original swap. As we are out of the money, both of these will cost money; the tear up will cost money now, the swap will cost money in the future (you'll be down the difference between the two fix rates).
If the market expects floating rates to rise significantly, then the swap may not be so far out of the money. In that case, you should be able to do the reverse swap for not too much spread between the fix rates, and similarly the tear-up should be cheap.
Suppose instead that we are doing arbitrage, and the swap is one we're thinking of buying rather than one we've already bought. To get rid of the floating rate risk on a quarterly swap (fixing on 3m Libor), we would need to buy a series of FRAs or Futures on the appropriate dates. The FRAs will pay out in the future, so we would net the difference between the swap fix rate and the FRA rate. A future will pay or require margin as soon as you buy it, and the account will vary all the way to the contract's effective date. This is the source of the convexity, which we need to adjust for to get the future's embedded rate expectation. But, as Christian points out, swaps these days are collateralised. So assuming standard daily cash collateralisation using the OIS index for interest, we will need to maintain a cash account with the moneyness balance of the swap. The future margin account will be dependent on the volatility of the futures, but the swap collateral account will be dependent only on the swap moneyness, so there is a risk that these will not match. We also need to keep in mind our relative cost of funding compared to OIS; if we are retail, we will get a spread over OIS, which raises the cost of the collateralisation. But I don't know whether retail institutions collateralise in the same way as interbank... if not then it's just back to open counterparty risk.
Another embedded risk in all this is counterparty risk; if the swap counterparty defaults, we will lose the float payments, and will be down the value of a Floating Rate Note if the swap was in the money. If it was out of the money, the counterparty's creditors will demand the value of the swap (or the continued payments), so we don't lose the downside either. Thus we need some kind of default protection; either a deep out of the money put (DOOM options) to cover against the counterparty's value disappearing - good for messy defaults - or a CDS. If we do a second swap to offset the first, we have the same risk of that counterparty defaulting too. And yes, the scenarios where one defaults are correlated with the scenarios where both default. For collateralised swaps, the risk is really down to the day-to-day movements (volatility!) as the collateral accounts will be up to date for the previous day. So the risk again, is dependent on the volatility of the swap's moneyness.
The alternative to all the counterparty risk is to do a cleared swap via a clearing house or a swap future via an exchange. These leave you exposed to the theoretically lower risk that the central counterparty will default. At least multiple trades may net out with a central counterparty. But you're back to a margin account and volatility exposure.
As AIG demonstrated, counterparties that sell CDS can also default, and they too are the scenarios where everyone else is more likely to default. But you have to wonder if anything will be sensible if all your counterparties die at once, particularly your CDS vendor. It wasn't sensible in 2008.
In short, if you're stuffed on a trade, get a realistic estimate of the costs of reversing it, then call up the original counterparty and tear it up.