A fractional-order controller will be proposed to regulate the inlet oxygen into the heart-lung machine. An analytical approach will be explained to satisfy some requirements together with practical implementation of some restrictions for the first time. Primarily a nonlinear single-input single-output (SISO) time-delay model which was obtained previously in the literature is introduced for the oxygen generation process in the heart-lung machine system and we will complete it by adding some new states to control it. Thereafter, the system is linearized using the state feedback linearization approach to find a third-order time-delay dynamics. Consequently classical PID and fractional order controllers are gained to assess the quality of the proposed technique. A set of optimal parameters of those controllers are achieved through the genetic algorithm optimization procedure through minimizing a cost function. Our design method focuses on minimizing some famous performance criterions such as IAE, ISE, and ITSE. In the genetic algorithm, the controller parameters are chosen as a random population. The best relevant values are achieved by reducing the cost function. A time-domain simulation signifies the performance of controller with respect to a traditional optimized PID controller.