If you had to repay an amount that you included in your income in an earlier year, you may be able to deduct the amount repaid from your income for the year in which you repaid it.
This is explained in IRS Publication 17 Your Federal Income Tax For Individuals, on page 69:
If you had to repay an amount that you included in your income in an earlier year, you may be able to deduct the amount repaid from your income for the year in which you repaid it. Or, if the amount you repaid is more than $3,000, you may be able to take a credit against your tax for the year in which you repaid it. Generally, you can claim a deduction or credit only if the repayment qualifies as an expense or loss incurred in your trade or business or in a for-profit transaction.
Type of deduction. The type of deduction you’re allowed in the year of repayment depends on the type of income you included in the earlier year. You generally deduct the repayment on the same form or schedule on which you previously reported it as income. For example, if you reported it as self-employment income, deduct it as a business expense on Schedule C (Form 1040) or Schedule F (Form 1040). If you reported it as a capital gain, deduct it as a capital loss as explained in the Instructions for Schedule D (Form 1040). If you reported it as wages, unemployment compensation, or other nonbusiness income, you may be able to deduct it as an other itemized deduction if the amount repaid is over $3,000.
Repaid social security benefits. If you repaid social security benefits or equivalent railroad retirement benefits, see Repayment of benefits. in chapter 7.
Repayment of $3,000 or less. If the amount you repaid was $3,000 or less, deduct it from your income in the year you repaid it.
Repayment over $3,000. If the amount you repaid was more than $3,000, you can deduct the repayment as an other itemized deduction on Schedule A (Form 1040), line 16, if you included the income under a claim of right. This means that at the time you included the income, it appeared that you had an unrestricted right to it. However, you can choose to take a credit for the year of repayment. Figure your tax under both methods and compare the results. Use the method (deduction or credit) that results in less tax.
CAUTION! When determining whether the amount you repaid was more or less than $3,000, consider the total amount being repaid on the return. Each instance of repayment isn’t considered separately.
Method 1. Figure your tax for 2020 claiming a deduction for the repaid amount. If you deduct it as an other itemized deduction, enter it on Schedule A (Form 1040), line 16.
Method 2. Figure your tax for 2020 claiming a credit for the repaid amount. Follow these steps.
If method 1 results in less tax, deduct the amount repaid. If method 2 results in less tax, claim the credit figured in (3) above on Schedule 3 (Form 1040), line 12d, by adding the amount of the credit to any other credits on this line, and see the instructions there.
To enter the credit into the TaxAct program:
The text "IRC 1341" will appear next to Line 13 on Schedule 3 (Form 1040) Additional Credits and Payments when the return is printed.
An example of this computation can be found in IRS Publication 525 Taxable and Nontaxable Income.
Note that any link in the information above is updated each year automatically and will take you to the most recent version of the document at the time it is accessed.