Your 401(k) contributions are deducted right from your paycheck and go directly into your account before taxes are withheld. So, if your salary is $50,000 a year and you contribute $3,000 to your 401(k), only $47,000 will be considered compensation for income tax purposes instead of $50,000.
When you withdraw money from your account in retirement, it will be subject to ordinary income taxes. But since you'll be retired, you'll possibly be in a lower tax bracket.
Consider taking full advantage of the tax-deferral by contributing the maximum amount allowed by the plan. Check with your human resources department for limits and details. Please keep in mind that all investing involves market risk, including the possible loss of principal.