The main objective of this study is to develop a new method for solving the techno-economic optimization problem of an isolated microgrid powered by renewable energy sources like solar panels, wind turbines, batteries, and diesel generators while minimizing greenhouse gas emissions. An Improved Salp Swarm Algorithm (ISSA) with a position adaptation mechanism for the salp leader that involves a leader salp that moves about depending on both food availability and its previous position has been proposed to overcome the convergence problem. In the original SSA, as the approach converges, it can no longer find optimal solutions and becomes trapped in a local minimum. Three Microgrid System (MS) configurations are discussed: PV/WT/BESU/DG, PV/BESU/DG, and WT/BESU/DG. The proposed method seeks to find a middle ground between technical criteria and environmental concerns when deciding on PV, WT, BESU, and DG sizes. The findings indicate that the proposed ISSA approach gives superior results compared to other well-known algorithms like the original SSA, the Ant Lion Optimizer (ALO), the Dragonfly Approach (DA), and the Moth-Flame Optimization Algorithm (MFO), which, after significant investigation, has been proven to help determine the appropriate microgrid size. With PV sizes of 10, 9 WT, 24 BESU, and 3 DG, the PV/WT/BESU/DG configuration offers the highest level of cost-effectiveness with Cost of Energy (COE) of 0.2109 $/kWh, Net Present Cost (NPC) of 376,063.8 $, Loss of Power Supply Probability (LPSP) of 4%, Renewable Energy Fraction (REF) of 96%, and CO2 emission of 12.4457 tons/year. ISSA is brought up as a possible solution to both the problem of rising energy prices and the difficulties inherent in microgrid design.