Is there some way to find if media items are used anywhere on the site?

There is very little reason to do this as disk space is cheap and even if you pay more for backup, the ROI here just do not justify the risk. Mainly the risk is that some media is being accessed from outside of the site, from a place that you have interest in continuing serving it.

If this is still a thing you want to do, the best way to go about it is compare your access log, filtered to the media related url, of the last X moths with the actual files that are in the media directory. The files that are never accessed should be a good candidate for deletion, although it is still better to first search for the relevant urls in the content before deleting anything.

You can probably automate such a thing, although unless you are in a true mess, my gut feeling is that manual labor might be cheaper in such a “one off” thing

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)