401k reduces your taxable income when depositing money.
The downsides are a 10% penalty for early withdrawal which makes them surprisingly bad for young people. They tend to start in lower tax brackets, have fewer reserves when unemployed, and face fewer risks from an unbalanced portfolio.
Pay down debt then Roth IRA when young 401k after 40 is often better than defaulting to a 401k, but saving anything tends to be more important than such optimizations.