Forest fires have become a major concern in the northern parts of Morocco, particularly in the Tangier-Tetouan-Al Hoceima (TTA) region, causing significant damage to the environment and human lives. To address this pressing issue, this study proposes an approach that utilizes remote sensing (RS) and machine learning (ML) techniques to detect burned areas in the TTA region within the Google Earth Engine platform. The study focuses on burned areas resulting from forest fires in three specific locations in the TTA region that have experienced such fires in recent years, namely Tangier-Assilah in 2017, M’diq Fnideq in 2020, and Chefchaouen in 2021. In our study, we extensively explored multiple combinations of spectral indices, such as normalized burn ratio (dNBR), normalized difference vegetation index (dNDVI), soil-adjusted vegetation index (dSAVI), and burned area index (dBAI), in conjunction with Sentinel-2 (S2) satellite images. These combinations were employed within the Random Forest (RF) algorithm, allowing us to draw important conclusions. Initially, we assess the individual effectiveness of the dNBR index, which yields accuracy rates of 83%, 90%, and 82% for Tangier-Assilah, Chefchaouen, and M’diq Fnideq, respectively. Recognizing the need for improved outcomes, we expand our analysis by incorporating spectral indices and S2 bands. However, the results obtained from this expanded combination lack consistency and stability across different locations. While Tangier-Assilah and M’diq Fnideq experience accuracy improvements, reaching 95% and 88%, respectively, the inclusion of Sentinel bands has an adverse effect on Chefchaouen, resulting in a decreased accuracy of 87%. To achieve optimal accuracy, our focus shifted towards the combination of dNBR and the other spectral indices. The results were truly remarkable, with accuracy rates of 96%, 97%, and 97% achieved for Tangier-Assilah, Chefchaouen, and M’diq Fnideq, respectively. Our decision to prioritize the spectral indices was based on the feature importance method, which highlights the significance of each feature in the classification process. The practical implications of our study extend to fire management and prevention in the TTA region. The insights gained from our analysis can inform the development of effective policies and strategies to mitigate the impact of forest fires. By harnessing the potential of RS and ML techniques, along with the utilization of spectral indices, we pave the way for enhanced fire monitoring and response capabilities in the region.