You cannot simply net your gambling losses against your winnings. You must report all of the lottery money as income. Then, if you itemize personal deductions (using Schedule A) instead of claiming the standard deduction, you can deduct gambling losses as an “other” itemized deduction. Such losses are not limited to what you spent on lottery tickets; they include all gambling losses (e.g., horse racing, bingo) that you can prove, but the total deduction for gambling losses cannot exceed the gambling winnings you report.
When debts are cancelled in bankruptcy cases, the cancelled amount is excluded from gross income. Tax attributes are certain losses, credits, and property basis that must be reduced to the extent of the exclusion.