The COVID-19 pandemic has caused more than 2.2 million deaths worldwide. The consequences of this disease are expected to continue. The COVID-19 pandemic has affected the global economy, demand for goods and services, and labor. This deadly virus has affected the energy demand in various sectors, the structure of energy production and especially renewable energy. Although judging the future of renewable energy requires a broader perspective, it is clear that the share of renewable energy in electricity generation, heating and energy policies must change after the COVID-19 pandemic. In this study, the optimal share of energy resources in Italy was calculated using the particle swarm optimization (PSO) algorithm and considering the changes in the energy system, energy demand and prices during the quarantine period.Current conditions and declining fossil fuel prices have led investors to reduce their investment in clean energy, and the amount of investment in renewable energy in 2020 has decreased by about 20% compared to the same period last year. The results of this study show that despite the ubiquitous limitations of COVID-19 for renewable energy, this period is a good opportunity to expand and invest in clean energy due to the increase in the share of electricity demand and domestic heating and the reduction of energy consumption in the industrial sector (Especially solar energy).