Deductions & credits

Thank you for the reply! This is helpful. In this specific scenario, I have not made any contributions to my 401k this year. With the sale of the investment property, I have a capital gain tax liability of about $400k. If I contribute the max annual contribution to my 401k ($30k, I am well above 50 years old) for 2023, will I be deferring/reducing the capital gain tax liability from the sale of the investment property? Ex. $400k from sales proceeds - $30k contribution to 401k = $370k capital gain tax liability for 2023. Hope my question makes sense and thank you in advance.