Heat transfer is one of the most fundamental engineering subjects and is found in every moment of life. Heat transfer problems, such as heating and cooling, where the transfer of heat between regions is calculated, are problems that can give exact solutions with parametric equations, many of which were obtained by solving differential equations in the past. Today, the fact that heat transfer problems have a more complex structure has led to the emergence of multivariate models, and problems that are very difficult to solve with differential equations have emerged. Optimization techniques, which are also the subject of computer science, are frequently used to solve complex problems. In this study, laminar thermal boundary layers in flow over a flat plate, a sub-problem of heat transfer, is solved with recent metaheuristic algorithms. Teaching learning-based optimization (TLBO), sine cosine optimization (SCO), gray wolf optimization (GWO), whale optimization (WO), salp swarm optimization (SSO), and Harris hawk optimization (HHO) algorithms are used in the study. In the optimization problem, the laminar boundary layer thickness, heat flow, and distance from the leading edge are determined. These three models’ minimum, maximum, and target values are found under the specified design variables and constraints. In the study, 540 optimization models are run, and it is seen that HHO is the most suitable optimization technique for heat transfer problems. Additionally, SSO and WO algorithms gave results close to HHO. Other algorithms also set model targets with an average of less than 0.07% and acceptable error rates. In addition, the average problem solution time of all optimization algorithms and all models was 0.9 s. To conclude, the recent metaheuristic algorithms are found to be powerful and fast in solving heat transfer problems.