This article is dedicated to analyzing the heat transfer in the flow of water-based nanofluids in a channel with non-parallel stretchable walls. The magnetohydrodynamic (MHD) nature of the flow is considered. Equations governing the flow are transformed into a system of nonlinear ordinary differential equations. The said system is solved by employing two different techniques, the variational iteration method (VIM) and the Runge-Kutta-Fehlberg method (RKF). The influence of the emerging parameters on the velocity and temperature profiles is highlighted with the help of graphs coupled with comprehensive discussions. A comparison with the already existing solutions is also made, which are the special cases of the current problem. It is observed that the temperature profile decreases with an increase in the nanoparticle volume fraction. Furthermore, a magnetic field can be used to control the possible separation caused by the backflows in the case of diverging channels. The effects of parameters on the skin friction coefficient and Nusselt number are also presented using graphical aid. The nanoparticle volume fraction helps to reduce the temperature of the channel and to enhance the rate of heat transfer at the wall.