Here are some ways that you can identify and remove unused Javascript:
Use Google PageSpeed Insights or Lighthouse – These tools highlight unused JavaScript and CSS, helping you pinpoint problem areas.
Manually audit installed apps – Some apps inject scripts even after uninstalling. Check Online Store > Themes > Edit Code and look for leftover app code in theme.liquid or snippets.
Try a Shopify speed optimization app – Apps like TinyIMG or Page Speed Optimizer can help streamline performance.