Sunscreens work much like any other barrier between you and the sun. They block the sun’s rays — and therefore the heat — before it reaches your windows.