Not when they put you down, but when they screw up in something not related to your relationship and say "I'm stupid" or "ugh I can't do anything right"

I get this a lot lately and I'm not sure how to handle it. On the one hand I don't want to tell her it's good behavior or say it's ok, because I know it's not and its stuff she needs to be better at. I also don't know how to word it without it backfiring. Most of the time I just ignore it long enough to where she says something else or forgets but other times I have to answer