Grid-tied microgrids play a crucial role by connecting renewable energy sources to the main power grid, contributing to sustainability and resilience in a balanced and effective manner. However, the dynamic interplay between the intermittent nature of renewable energy sources and the volatility of load fluctuations presents a multifaceted array of intricate energy management complexities. This study aims to formulate optimization techniques for energy management systems based on renewable energy resources and standalone diesel systems. The proposed system consists of a wind turbine, a photovoltaic system, a standalone diesel generator, and a battery energy storage system, along with flexible and non-flexible loads tied to the local grid. Battery energy storage acts as a primary backup system, while diesel generators act as a standalone secondary backup system. The performance of the proposed optimization technique is validated using Matlab/Simulink, substantiating its performance and robustness, thus affirming its pragmatic suitability for real-world implementation. A comparison has been made with other optimization techniques and found that the proposed technique gives enhanced efficiency, improved resource allocation, load scheduling, and greater adaptability to varying demand and supply dynamics. Moreover, the proposed system exhibits a superior ability to achieve optimal energy utilization and realize noteworthy cost savings in comparison to the alternatives that underwent evaluation.INDEX TERMS Adaptive Genetic Algorithm, grid-tied microgrid, bidirectional converter, cost optimization, renewable energy resources, peak average ratio, load scheduling, resource allocation.