The 1099-Q form shows distributions from education savings accounts and 529 plans. The form has the gross distributions, plus the basis and the earnings on that distribution. If you don’t report education expenses to offset the 1099-Q distribution, then the earnings will be taxable as ordinary income plus a 10% penalty. The 10% penalty is basically for taking the money out but not using it for educational purposes.
The trick here is that you can’t use the same dollars for education credits and offsetting the 1099-Q distribution. If you have $5k of education expenses with your $5k distribution, you can either use the education expenses to offset the distribution, or you can use a portion to claim the education credit, but then pick up the income on the distribution. If you used $4k to claim the American Opportunity Credit, then you would have $1k to offset the 1099-Q distribution.
The result in that example would be 20% of the earnings on the distribution would be offset, but the other 80% would be taxable plus penalty. Usually the education credits are better, but it depends on your specific situation. It’s just something to keep in mind. Whichever way you go, you just need to be sure to report that distribution.