Wireless body area network (WBAN) is an emerging technology that has been able to provide a better experience of mobility and flexibility for humans using tiny and low power sensors inside, outside, or around the body compared to the traditional wired monitoring systems. Due to numerous constraints in size, energy consumption, and security of implant devices in the human body, it is still a significant research challenge to design these systems in a reliable and energy-efficient fashion. To provide quality of service, timely and secure delivery of real-time data needs to be done without any loss. This paper attempts to provide a communication protocol in order to upgrade QoS levels in WBANs and reduce energy consumption in sensor nodes. To do so, the earliest deadline first (EDF) real-time scheduling algorithm and its combination with the least laxity first (LLF) scheduling algorithm were employed to prioritize sensor nodes for sending data packets. The proposed method could optimize the system performance when it is in the event of an overload and tasks miss their deadlines in a row. The OMNET++ simulation environment is used to evaluate the proposed solution's efficiency which checks packet delivery rate and mean-power consumption evaluation criteria in the sink and sensor nodes. This is done with different numbers of nodes in the network. The results show that the proposed strategy could provide an appropriate improvement in sending and receiving packets for body area networks.