In pages 68-71, they described the Pixel Level Quality Indicators for masking clouds. I suggest you to take a look at this document. Hope that helps you!
There is a "Bitmask" band augmented with other bands of each product, for instance, the "QA60" band of Sentinel-2: https://developers.google.com/earth-engine/datasets/catalog/COPERNICUS_S2
If you aren't concerned about the data for certain dates, you can use the multi-dimensional median (medoid) technique to generate the best available monthly or yearly pixel composite.
Article Seasonal Composite Landsat TM/ETM plus Images Using the Medo...