Climate change significantly impacts the demand for more renewable energy sources. Exploring renewable energy solutions such as photovoltaics (PV) is critical to solving the challenges of intermittent energy supply and power fluctuations. These concerns can be mitigated by adopting proper energy storage technology. A hybrid energy storage system (HESS) integrates several storage elements with complementary charge and discharge characteristics to generate the required energy and power. Their power and energy densities can distinguish different types of energy storage systems. Combining supercapacitor and battery energy storage technologies can help with intermittent energy supplies. This research proposes a strategy for attaining the most efficient power distribution for HESS using renewable energy systems such as PV. A mixed integer linear programming (MILP) method is used. Then, this method is compared to the rule-based approach to achieve the best HESS power allocation. This research study proposes a method for determining the optimal quantity of electricity to employ in various energy storage systems. The goal is to lower each storage system's total project cost (TPC) and operation and maintenance (O&M) costs. The simulation funding reveals that the charge and discharge values are larger than the MILP method when using a rule-based approach. The total power cost, or HESS power cost, in the MILP method, is lower than in the rule-based approach, with a difference of $0.081517.