The efficiency of solar panels decreases gradually with the increase of solar cell temperature. To solve the problem, various researches have been carried out. This article studies the effect of using a cooling system on the useful energy and the overall efficiency of a photovoltaic (PV) panel. First, a numerical study has been carried out to reduce the temperature of photovoltaic panels using cooling fluids. To achieve our goal, a modeling of the heat flows between the panel components and the cooling fluid was performed, and then a matlab simulation to optimize the efficiency of the PV panel was run. A heat exchanger consisting of rectangular pipes was chosen to ensure a maximum heat exchange surface with the fluid. The choice of operating conditions and geometrical parameters was made according to the cell temperature, which must be minimal. The metrological conditions are collected from the metro central corresponding to the region of Gabes located in southern Tunisia. To further enhance the performance of solar collectors, different cooling fluids were tested including nanofluids. After testing the thermal behavior of different fluids, MgO was chosen as the best operating nanofluid. Using this nanofluid, the overall power increased by 400 W m−2 compared to that obtained with water. In addition, the electrical energy of the panels increased by 12.17% compared to water.