These tax-planning strategies could help you save thousands of dollars.