If you take an unqualified distribution from the 401(k), the entire amount is taxable income subject to a 10% penalty. The plan administrator will withhold 20% for Federal income tax. When you file your tax return, you will be assessed the 10% penalty. If the 20% withheld does not cover the taxes and penalty due, you will have to pay the additional amount then. If your withholdings are too low for that year, you may also be subject to an underwithholding penalty. And then, there's your state. Your state may also assess a penalty in addition to the state income tax. You could end up with less than half of your 401(k) balance.
On the other hand, if you roll your 401(k) to an IRA, no taxes or penalties will be due. Contact an IRA provider (bank, full service brokerage, discount online broker, mutual fund company) of your choice and they'll assist you. You'll have to fill out some paperwork, make some decisions as to investment allocation, and they'll take it from there.