Break code into components and then Assembly. As the whole world gathers frontend
At the moment when you're spaghetti css unpacking section you will find unused styles.
But it's in the trio: css, html, js - the only way you will find for all.
Another option - I see that the css tainted (no prefix, no BEM, etc.), then spend the name for the entire project. In the code, layout in js it will find all occurrences. If you can't find - feel free to delete it. But - provided that you know how the project works. And that will screw up if there is a dependence on something third-party is.
css should be clean. It must be divided into modules files. And then chaos will not. And to combine all the files in the same webparam