Unfortunately, directly applying a cloud masking algorithm to a KML file isn't feasible. KML files define geographic features like points, lines, and polygons on a map. They don't store image data itself.
Cloud masking algorithms typically operate on raster data from satellite imagery, such as Landsat 8. However, you can achieve cloud masking for your Landsat 8 image within the area defined by your KML file using (I) GIS Software, e.g., ArcGIS Pro or QGIS (common options include using the Quality Assessment band). (ii) Google Earth Engine (GEE): By the scripting of cloud-masking algorithms using the Landsat 8 archive and your KML boundary as a filter.
Thank you, Ali Younes, for your response. I have tried the approaches you suggested, but I am facing the specific issue with Landsat 8 C2L2T1 data. Although I have assessed the percentages of cloud cover over each kml, I am struggling to map the distribution of the cloud pixels. Without this mapping, masking the clouds becomes quite challenging.