You cannot withdraw funds from your 401k at any time for a number of reasons, primarily to protect your retirement savings. There are only two real times when you will be able to withdraw money from your account: when you have reached retirement age or for a brief period immediately after leaving a job. There are, however, penalties for withdrawing funds from the account before reaching retirement age that will actually reduce your savings. This is something that needs to be considered very carefully.
You can withdraw your funds normally after reaching retirement age, which is 59 years and 6 months. You will have to pay taxes on these withdrawals, but that's because with a traditional 401k account your contributions were made from your pre-tax income, which means you defer paying taxes on your income until you make those withdrawals at retirement.
If you decide to take a payment before this time, when you have just left a job, you will have to pay both federal and state taxes, as well as a ten percent early withdrawal fee. This is a steep price to pay, depending on your percentages it can be up to thirty to forty percent of your total withdrawals. Not only do you lose that money, but you also lose the money that it would have earned for you until you reach the point of retirement. Any financial expert you talk to will recommend that you find another way to secure funds than withdrawing money from your 401k early because of these fees.
After careful consideration, if you decide that's still what you need to do, you'll want to start immediately after you quit your job. The company you worked for will own twenty percent of what you take out for the penalty and taxes, and by the time you do your taxes at the end of the year, you will be responsible for paying that. what's left of what you owe on that withdrawal in your taxes, so make sure you keep some of it for that.
Taking an early 401k withdrawal is a serious decision that will need to be carefully considered and then planned within your budget.