Conventional electricity generation is one of the greatest sources of CO2 emissions. For a successful transformation of conventional energy systems into non-polluting and renewable energy systems, technology-focused traditional systems and economics must be combined for a more accurate holistic viewpoint with consideration of socio-political, technical, economic and environmental factors. Hybrid energy systems are considered the most feasible solution to the stochastic nature of renewable energy resources (RERs). Different renewable sources such as wind, solar, and hydrogen fuel cells can be integrated to form hybrid systems. An energy management strategy (EMS) is a strategy for power flow coordination among different components, by considering power demand and other constraints. The choice for an accurate EMS is the key element of a hybrid system as it is instrumental in providing an optimum solution of the hybrid system design and operation management. The objective of the optimization is to find suitable configurations for cost-effective solutions. Optimization and EMS must be treated as one entity to completely understand the system design. This study focuses on a techno-economic analysis with an optimized sizing of a hybrid renewable energy system (HRES) components to meet the residential load demand of a specific area in Pakistan. Nine different scenarios based on the PV-wind-diesel-BSS-converter system are investigated in terms of total net present cost (TNPC), Levelized cost of energy (LCOE), and greenhouse gas (GHG) emissions to find the optimal system design. HOMER Pro software is used to develop the HRES model and for simulation analysis, with optimal sizing of each component for an economical solution. Simulation studies established that PV-wind-BSS-converter is the best suitable choice for the given location, and the optimal component sizes were determined. The TNPC of this system is $47,398 and the LCOE is $ 0.309/kWh. This represents an 81.7 % decrease in overall cost, compared to the base case (diesel only) and a 100% reduction in harmful gases while satisfying 100 % of the energy requirement with a 63.9 % of the surplus. MATLAB/Simulink model is developed for the optimum HRES system design. Its validity is tested by maintaining bus voltages (dc and ac), the secure operation range of storage SOC and real power balance among different components of the hybrid renewable energy system (HRES), and an effective ac voltage, irrespective of external perturbations. Model predictive control (MPC) is regarded as a high-performing algorithm. Since power converters are largely applied in microgrids (MGs), the problem formulation with MPC for a reconfigurable bidirectional voltage source converter (VSC) is applied in this work for hybrid MG. The inevitable fluctuations due to the linear and non-linear loads and the nature of renewable sources are addressed. The regulation of ac voltage is implemented through a finite control set model predictive control (FCS-MPC) based active front end (AFE) rectifier, while direct power MPC (DPMPC) is used to control the power during grid-connected operation. The regulation of an ac load voltage is done through voltage based MPC (MPVC) in the islanding operation of the MG. Moreover, the HRES transition from grid-tied to grid-isolated mode is comprehensively analyzed. MATLAB/Simulink <sup xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">®</sup> software certified the robustness and evaluated the performance of the proposed HRES model under different varying loads viz. balanced, unbalanced, and nonlinear. The proposed strategy offers superior performance with low total harmonic distortion (THD), compared to previously developed strategies. The output waveform of voltage and current have THD of 0.28 % compared to 3.71 % with the conventional strategy. The contributions of this paper lie in the sequential use of HOMER as well as MATLAB tools and in the validation of the suggested HRES plan for the considered location; along with the implementation of FCS-MPC for a reconfigurable bidirectional VSC.