system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: What is a 401(k) and how does it work?
gpt
It's a type of tax-advantaged retirement account available in the US, set up by employers for their employees to use. The employee controls how much money gets put in, up to a certain amount ($18,500 for this year). The money is withdrawn straight from their paycheck to deposit in the account. The money is usually invested rather than just sitting in a savings account. In some companies, the company will match part or all of an employee's contributions to the account. You have to pay a penalty if you withdraw money from the account before you're 59.5 years old.

There's two ways to put money in: either traditional (you don't pay income taxes on the money now, but you do pay taxes when you withdraw the money in retirement) or Roth (you pay income taxes now, you don't pay any income taxes on the money when you withdraw in retirement).