Adaptive niche genetic algorithm (ANGA) and lung ultrasound were combined, the death warning mathematical model was established for patients with sepsis-lung injury, and the epidemiological characteristics were analyzed to explore the efficacy of Vancomycin in the treatment of sepsis-lung injury. First, 88 sepsis patients with lung injury were selected as the research objects. General clinical data and pulmonary ultrasound results were collected. On this basis, epidemiological analysis was carried out, and the death warning model of patients with sepsis-lung injury was established based on ANGA algorithm. Then, the total cure rate, Staphylococcus aureus (SA) clearance rate, methicillin-resistant SA (MRSA) clearance rate, and the incidence of adverse reactions after intravenous infusion of Vancomycin were analyzed. The results showed that the ANGA mathematical model combined with the random forest (RF) classifier proposed had better classification effect and robustness relative to the traditional principal component analysis and NGA. The early warning accuracy of the proposed ANGA + RF mathematical model was higher than 95% in contrast to that of the APACHE-II score and the SOFA score. Compared with patients in the severe group, the MRSA infection rate and the levels of procalcitonin (PCT), C-reactive protein (CRP), and activated partial thromboplastin time (APTT) of SA sepsis-lung injury patients were greatly reduced, while thrombin time (TT) and D-D dimer in the death group were considerably increased (p < 0.05), and the PLT level was greatly reduced (p < 0.05). In addition, the total cure rate, SA clearance rate, and MRSA clearance rate of Vancomycin-treated SA sepsis-lung injury patients were significantly increased (p < 0.05) compared with patients in the conventional treatment control group. However, the probability of adverse reactions was increased notably (p < 0.05). ANGA combined with RF classifier can improve the accuracy of death warning in patients with sepsis-lung injury. Vancomycin can effectively eliminate MRSA infection rate in patients with sepsis-lung injury and improve the treatment effect of patients.