There is a bit of a catch. Assuming you meet the qualifications to make a contribution to your Health Savings Account (HSA), for the contribution to be deductible, you must have made the contribution directly to the HSA with after-tax dollars.
When contributions are made to your HSA through payroll deductions (reported on your W-2 in box 12 with code W), they are done with pre-tax dollars and therefore do not show on your tax return as a deductible contribution. Instead, your taxable income in box 1 of your W-2 is lower than it would have been without the HSA contribution.