Matrix Server
Free up space in Matrix Synapse
Save any media you want to keep somewhere else or backup the whole folder for archiving.
Now go to /var/lib/matrix-synapse/media and remove everything from local_content/. Feel free to also delete the thumbnails.