A Withdrawl (i.e. permanent) you'd have to see if your situation is covered by an exception to the IRS rules.
If you're just looking for cash now, you can get a TSP loan and then pay it back over a 5 year period. If it's for purchasing a home, you can pay it back over 15 years. While you have the money out, you are essentially paying (to yourself) whatever the G funds rate is (usually around 3%) over the course of the loan. The potential downside of taking a loan out is you miss out on any returns on the market makes while your money is out.