There are ETFs that specifically exclude companies with lots of negative externalities (no Exxon, etc.). The term to look for is "socially responsible".
E.g. https://www.ubs.com/uk/en/assetmanagement/funds/etf/lu062945...