State income taxes and sales tax are both potential deductions for your federal income tax. They're only potential write-offs because you have to itemize on Schedule A in order to take them off. If you go with the standard deduction -- $11,900 for couples filing jointly for the 2012 tax year -- all the itemized deductions are off the table.
You can claim state and local income taxes as a federal write-off, unless the income is exempt from federal taxes. If your state taxes an income stream that the federal government does not, the tax isn't deductible. If your employer withholds state income tax this year, you can report the payments as an itemized deduction. If you're self-employed and make state estimated tax payments, you can deduct those as well.
If you get a refund after itemizing your state tax withholding, the refund becomes taxable income. That applies whether it was due to overpayment or to an error. You report it on the following year's income taxes, so you don't have to go back and change your original deduction. With estimated taxes, it's trickier as the IRS requires you file them in "good faith." If you deduct estimated taxes when you're confident you'll get a refund, your deduction wasn't legal.
Joint or Separate
If you and your spouse file separate tax returns, you can only claim the state income tax that applies to your own income. If you file joint state returns and a separate federal return, you can each claim a percentage of the state tax: If you make 60 percent of the family income, you get to write off 60 percent of the tax. However, if 60 percent of the tax adds up to more than your employer withheld, you only get to deduct the actual withholding amount.
You can deduct state sales taxes or state income tax but not both. If you opt for sales tax, you have two ways to figure it. One is to track the actual sales tax you spent over the year and report it. The other is to use the tables in Schedule A or the IRS online calculator to figure an estimated sales tax and deduct that. If your state collects use tax on out-of-state purchases, you can deduct that too.