Background: Heat-related illnesses are a critical concern for military personnel, especially those unfamiliar with hot climate regions. The Royal Thai Army (RTA) implements a 10-week military training program encompassing four phases: (1) Heat acclimatization training, (2) Combat fundamentals and unarmed combat training, (3) Armed combat training and tactical training, and (4) Field training exercise and evaluations. Objective: This study aimed to conduct a predictive analysis of heat-related illnesses to enhance prevention programs. Methods: The study utilized secondary data from the RTA Medical Department, incorporating variables such as age, occupation, education, underlying diseases, smoking and alcohol consumption, sleep duration, exercise, medication history, body mass index (BMI), weight loss, body temperature, dark urine, heat rash, and environmental humidity. Multiple machine learning algorithms were employed to develop predictive models. Results: The samples comprised 809 male recruits (103,051 encounters) with an average age of 22. Approximately 12% of the recruits had a BMI ≥30 kg/m2, while nearly 70% and 90% reported tobacco use and alcohol consumption in the past 12 months, respectively. Among the recruits, 16% reported substance use within the preceding 30 days. The eXtreme Gradient Boosting (XGB) model achieved 91% accuracy in predicting heat-related illnesses before Phase 2. The top five predictive variables were Lopburi Province (central region), Songkhla Province (southern region), and Bangkok (capital city), sleep duration before joining military training (hours), and age (years). Conclusion: This study, which applied machine learning techniques to predict heat-related illnesses among Thai recruits, can potentially impact the health and training of military personnel. The comparative analysis of various algorithms identified the XGB model as the optimal performer in predicting heat-related illnesses during the combat fundamentals and unarmed combat training phase. However, it is essential to note that further study is needed to enhance the applicability of our predictive model, which includes expanding its use to new cohorts of Thai conscripts, underscoring our research’s ongoing nature.