What do I do if my Zotero database is corrupted?
Zotero stores your information in a database file, zotero.sqlite, in the Zotero data directory. If the database becomes corrupted, Zotero may no longer be able to start up, or certain operations might fail.
Database corruption generally occurs when the data directory is placed in a cloud storage folder or on a network drive. If you've moved your data directory to one of those places, you should move it back to the default location. You should never store the data directory in cloud storage. (The same applies to any database-backed program.)
If the database was in cloud storage or you have a local backup, you can try to restore from an earlier version of zotero.sqlite, including one of the last automatic backups in your Zotero data directory, by closing Zotero, moving the current zotero.sqlite out of the way, and copying the backup file into place as zotero.sqlite. After restoring from a backup, check the database integrity from the Advanced → Files and Folders pane of the Zotero preferences.
If you don't have a backup, or the backups are corrupted as well, you can try to fix the damage with the Zotero Database Repair Tool.
Alternatively, if you were using Zotero syncing and your data is all online, you can just delete the zotero.sqlite file (or move it somewhere temporarily for backup) with Zotero closed and then reopen Zotero and sync to pull down your library. You can also safely restore to an earlier, uncorrupted version of your database, and Zotero will simply pull down changes since the last time you used that database, without needing to redownload your entire library.