Hybrid renewable energy sources and microgrids will determine future electricity generation and supply. Therefore, evaluating the uncertain intermittent output power is essential to building long-term sustainable and reliable microgrid operations to fulfill the growing energy demands. To address this, we proposed a robust mixed-integer linear programming model for the microgrid to minimize the day-ahead cost. To validate the proposed model piecewise linear curve is to deal with uncertainties of wind turbine, photovoltaic, and electrical load. The proposed solution is demonstrated through a case study compared under a robust worst-case scenario, deterministic model, and max-min robust optimization that aim to find optimal robustness. So, a piecewise linear curve is considered to obtain uncertain parameters in order to deal with uncertainties and predict the day-ahead cost. This study illustrates how the Uncertainty Budget Set selection used to integrate renewable energy sources into a microgrid, which manages the energy system. Therefore, the model complexity was slightly modified by adjusting the Uncertainty Budget Set to obtain the optimal decision and control the load demand and uncertainty of renewable energy sources. The comparative results demonstrate that the proposed robust optimization can achieve high solutions under microgrid's availability and is intended to confirm that the proposed method is more cost-effective than alternative optimization techniques. Additionally, the effectiveness and advantage of the proposed methodology in the IEEE 33-node system are validated in this case study by comparing it to the existing optimization. The comparison results show that the proposed robust optimization methods illustrate the model's efficiency, concluding remarks, and managerial insights of the research.