In the 1980s, pension plans became too expensive for employers to keep paying the employees that didn’t work for them anymore. As a result, they replaced pension plans with 401 (k) plans, although they were at first intended as a supplement to pensions.
There are 2 kinds of 401(k) plans:
Traditional (the most common):
Traditional plans penalize you 10% if you withdraw money prematurely; taxes are paid upon withdrawal instead of when contributed, and you can’t access your funds without the 10% penalty until you are 59.5 years old or quit by the age of 55 and onwards.
Funds are taxed upon or before contribution so you don’t pay on withdrawal. You have free access to the funds after 5 years of holding an account.
These 401(k) plans allow you to set aside part of your paycheck and invest it in whatever way you choose. Options include target-date funds and bonds, stocks, and money markets in mutual funds. You can choose to put in as much as you like and as long as you stay under your salary amount, or a certain constant amount that the IRS limits annual contributions to, each year. You need to keep enough to live on though, and usually employers match your contributions up to a percentage of your salary (usually 3%) which is also figured into your annual limit.
Employers will sometimes restrict you from withdrawing their contributions, not yours, for a period of time before you can withdraw them. However, as stated above, it is probably not a good idea to withdraw at all even after that period of time since that would cost you quite a bit of money in penalties and lost interest, unless of course, you have a Roth 401(k), in which case, you have to wait 5 years.
The best strategy is to invest at least as much as the employer matches, and don’t withdraw until retirement. That being said, if the company goes down, you can still save your 401(k) by rolling over into a traditional IRA and avoiding the 10% penalty, or simply withdrawing the money and pay the penalty. If you go down, your elected beneficiary or your spouse gets the money.