Thermal power plants have long been essential to the fossil fuel-based electricity supply chain, according to statistics studies. Nevertheless, due to the enormous initial and ongoing expenses of modern power plants as well as their negative environmental effects. This manuscript proposes a hybrid technique for grid-connected load-following hybrid photovoltaic and wind microgrid with a grid-connected electric vehicle charging system. The proposed hybrid technique is the joint execution of both Young's double-slit experiment optimizer (YDSE) and the Tree Hierarchical Deep Convolutional Neural Network (THDCNN). Hence, it is named as YDSE-THDCNN. The major objective of the proposed technique is to reduce the fuel, operation, and maintenance costs, as well as to reduce the environmental costs and maximize the efficiency of the system. The proposed YDSE technique is utilized to generate the control signal of the inverter and the optimal signal will be predicted by the THDCNN. By then, the MATLAB working platform has adopted the proposed way, and the existing method is used to compute its execution. The proposed method outperforms any existing techniques, including the Genetic Algorithm (GA), Butterfly Optimization Algorithm (BOA), and Particle Swarm Optimization (PSO) Algorithm. The existing method shows the cost of 2.6$, 3.8$, 4.6$, and the proposed method shows the cost of 1.3$ which is lower than the other existing method.