British people (perhaps among others) are known for removing as many clothes as practical or possible when it is hot. But in many hot countries, they don't do that: they wear more clothes, perhaps several layers.
The problem is when you get sunlight directly on the skin. As we know, most things in direct sunlight get hot, sometimes very hot, and skin can burn.
If the skin is covered in fabric, that will get hot, but a loose fitting garment allows air to circulate. So the skin underneath the clothing is not only protected from the direct radiation from the sun, but cooled by moving air.
If you add another layer of clothing, the inner layer of fabric next to the skin does not get directly heated by the sun's radiation. But it seems counter-intuitive to wear more clothes – in my country we put on more clothes when we are cold.
What about the colour? Light coloured clothing reflects heat more effectively, but is a poor radiator. Conversely dark clothing is a poor reflector but a good radiator. But we also need to lose body heat: that is from the cooling effect of moving air, as well as by radiation. There have been studies comparing the effect of dark and light clothing. Some cultures seem to prefer light, others dark.
Following a comment from henning a previous answer states
The amount of heat gained by a Bedouin exposed to the hot desert is the same whether he wears a black or a white robe. The additional heat absorbed by the black robe was lost before it reached the skin.
I have satisfied myself that it is better to wear clothing to stay cool, by my own experience. I was waiting for a shared taxi to get its full complement of passengers before it would leave. That took about 2 hours. The morning was getting hotter and the sun higher. Inside the taxi was furiously hot, so it wasn't realistic to wait in it, and there was no other shade.
I rolled down my sleeves, put on a brimmed hat, plus a sleeveless fleece with the zip open, and stood with my back to the sun. The fleece was hanging away from my back so that air could circulate. I was quite comfortable, but another person present was suffering. They caught the sun, and drank all their water before the journey had even begun.