The first thing I would do is Tools > Check Media (on Desktop will be easiest), and deleting your unused media. If you’re lucky, the problematic file isn’t even one you need.
Then you could check your collection.media – Managing Files - Anki Manual . Sort by size and see if you can identify any large files that you could make smaller by editing, changing resolution, converting to a different file type, etc.
For that error, pretty much the same suggestions as I made above - Sync error after update to 24.04 - #9 by dae .