The centralized power grid bears a heavy burden in a time when consumers expect an uninterrupted reliable power supply, a reduction in carbon emissions, increased efficiency within the national grid, and power supplied to remote communities. One such structure is used to implement this type of control that is based on small- scale Distributed Generation (DGs), at a single house or a small building level: micro-grid (μG). A μG is an autonomous, sustainable hybrid framework that uses renewable and non-renewable energy resources to supply continuous electricity to the load. Taking this scenario into account, the three sources of generation that have been utilized in the proposed μG are Photovoltaic (PV) array, Fuel Cell (FC), and Wind Turbine (WT) in this research paper. The active and reactive power of all three generation resources has been controlled using various controllers, i.e., integral, proportional-integral, proportional derivative, proportional integral derivative, fractional-order proportional-integral, Fractional Order Proportional Integral Derivative (FOPID), and Sliding Mode Controller (SMC). An advanced optimization technique based on a Genetic Algorithm (GA) and Particle Swarm Optimization (PSO) algorithm has been utilized to optimize all these controllers. The integral square error has been taken as the objective function for both optimization algorithms. Finally, a graphical and tabular comparative analysis of all optimized controllers along with their control parameters and performance indexes has been evaluated to find the best optimal solution using MATLAB/Simulink. The performance of SMC has been surpassed the performance of all other optimized controllers for the power stability analysis. Moreover, a smart switching algorithm has been introduced for switching between the generation resources following the load demand and cost of the system to operate the μG more economically. Finally, a case study has been performed in which the smart switching algorithm has been utilized to switch to the best available generation resource in case of any fault at the generation side to provide uninterrupted power to the attached loads.