This paper investigates energy management in smart microgrids by incorporating energy storage batteries to improve the operational cost efficiency and system reliability. The considered cost and reliability index are respectively the battery costs and the loss of load expectation (LOLE). Since operational indices depend on location and costs on battery capacity, the main challenge is determining the optimal capacity and installation location for batteries. To achieve both objectives, the functions are consolidated into a single overarching objective function. This problem is addressed through a novel optimization algorithm known as the Symbiotic Organisms Search (SOS) algorithm. Unlike other heuristic algorithms, the SOS algorithm requires no specific tuning parameters, allowing for faster convergence. To verify its efficiency, the algorithm’s results are compared with those of the widely recognized Genetic Algorithm (GA). A sodium-sulfur (NaS) battery is selected for this study due to its high power density, efficiency, and long life cycle. Renewable energy sources utilized in this study are in the form of wind turbines and photovoltaic (PV) cells. The proposed methodology is tested on the IEEE 33-bus system, with results confirming its practical feasibility.