When you’re viewing the Media Library, there are two views: List View and Grid View.
If you switch to List View, you’ll see a column titled, “Uploaded to”. When an image is being used on a post or page, that column will contain a link to the post or page where the image is being used. If an image is NOT being used anywhere, it will indicate, “(Unattached) ”.
You can then safely delete any image that is not in use.
You might also check out the Media Cleaner plugin. It cleans your Media Library from any files which aren’t being used in your website, as well as any broken entries.
It also has its own internal trash, so you can make sure everything is still working properly before permanently deleting any files.
Hope this helps!