Traditional individual retirement arrangements offer tax-deferred savings for your retirement nest egg, which means you get a deduction for contributions and pay taxes on withdrawals. While it won't help you to take a distribution just so you can fund your annual contribution and claim a deduction, there's nothing in the Internal Revenue Code that stops you from doing so.
TL;DR (Too Long; Didn't Read)
The federal government allows you to take an IRA deduction in the same year that you took a withdrawal.
Evaluating Deductions Permitted
You can deduct your traditional IRA contributions regardless of whether you took a distribution in the same year, even if its from the same account, because the two transactions are treated separately. When you file your income taxes, you would report the amount of the withdrawal as a taxable IRA distribution and then deduct your contribution as a deductible IRA contribution. However, because of the early withdrawal penalties, even if you contribute the same amount as you took out, the two might not cancel each other out.
Early Withdrawal Penalty
If you're under 59 1/2, you owe a 10 percent early withdrawal penalty on your distribution unless an exception applies. Exceptions are limited to the list given in IRS Publication 590-B, which includes being permanently disabled, paying for higher education expenses, buying health insurance after losing your job, and taking out up to $10,000 to buy a first home. For example, say you're 45. If you take a $5,000 withdrawal in January 2017 and then in July contribute $5,000 to your the same account, the contribution deduction will offset the income from the withdrawal, but you'll still be on the hook for a $500 penalty.
Understanding Rollover Contributions
Rollover contributions to an IRA aren't counted as taxable distributions nor are they counted as deductible contributions. In fact, rollovers don't have any impact on your ability to make or deduct your annual contributions. For example, say you took out $10,000 from your traditional IRA, but rolled it over into another traditional IRA within 60 days. That $10,000 doesn't count as a taxable distribution, and it doesn't get hit with the early withdrawal penalty, but you can't deduct that $10,000 as an IRA contribution. However, you are still eligible to make and deduct an annual contribution.
Retirement Savings Credit
Unlike the IRA deduction, your eligibility for the retirement savings credit is affected by any withdrawals you took from your IRA in the same year. In fact, you must reduce your IRA contributions considered for the credit by any distributions taken not only during that year, but also during the two years before and the time between the end of the year and your tax filing deadline. For example, say you put $5,000 in your traditional IRA in 2017, but you also took a $4,000 distribution. You could only count $1,000 of your contributions when figuring your retirement savings credit.