In response to the urgent global threat posed by human-induced extreme climate hazards, heatwaves are still systematically under-reported and under-researched in Thailand. This region is confronting a significant rise in heat-related mortality, which has resulted in hundreds of deaths, underscoring a pressing issue that needs to be addressed. This research article is one of the first to present a solution for assessing heatwave dynamics, using machine learning (ML) algorithms and geospatial technologies in this country. It analyzes heatwave metrics like heatwave number (HWN), heatwave frequency (HWF), heatwave duration (HWD), heatwave magnitude (HWM), and heatwave amplitude (HWA), combining satellite-derived land surface temperature (LST) data with ground-based air temperature (Tair) observations from 1981 to 2019. The result reveals significant marked increases in both the frequency and intensity of daytime heatwaves in peri-urban areas, with the most pronounced changes being a 0.45-day/year in HWN, a 2.00-day/year in HWF, and a 0.27-day/year in HWD. This trend is notably less pronounced in urban areas. Conversely, rural regions are experiencing a significant escalation in nighttime heatwaves, with increases of 0.39 days/year in HWN, 1.44 days/year in HWF, and 0.14 days/year in HWD. Correlation analysis (p<0.05) reveals spatial heterogeneity in heatwave dynamics, with robust daytime correlations between Tair and LST in rural (HWN, HWF, HWD, r>0.90) and peri-urban (HWM, HWA, r>0.65) regions. This study emphasizes the importance of considering microclimatic variations in heatwave analysis, offering insights for targeted intervention strategies. It demonstrates how enhancing remote sensing with ML can facilitate the spatial–temporal analysis of heatwaves across diverse environments. This approach identifies critical risk areas in Thailand, guiding resilience efforts and serving as a model for managing similar microclimates, extending the applicability of this study. Overall, the study provides policymakers and stakeholders with potent tools for climate action and effective heatwave management. Furthermore, this research contributes to mitigating the impacts of extreme climate events, promoting resilience, and fostering environmental sustainability.