Researchers have lately been interested in intelligent healthcare systems because of its significance in an IoT setting. In these scenarios, biomedical sensors are implanted into patients in order to collect data on their health status throughout a wireless body area network (WBAN). The suggested approach splits the body into an upper, lower, and centre section. A more refined version of the LEACH clustering technique is used in each area. As a further step, we apply an evolutionary technique called the whale optimization algorithm (WOA) to choose out our cluster leaders. For the purpose of assessing the efficacy of the suggested technique, the algorithm is implemented in a Matlab platform and evaluated to the conventional Algorithms, which has been suggested before for the same kinds of problems. The suggested system provides longer battery life for devices in a wireless body area network, and it surpassed the alternatives.