The sunshield separates the observatory into a warm, sun-facing side (thermal models show the max temperature of the outermost layer is 383K or approximately 230 degrees F), and a cold side (with the coldest layer having a modeled minimum temp of 36K or around -394 degrees F). The five-layer sunshield keeps sunlight from interfering with the sensitive telescope instruments. The telescope operates under 50K (~-370F) Photo: Northrop Grumman
The James Webb Space Telescope will observe primarily the infrared light from faint and very distant objects. In order to be able to detect those faint heat signals, the telescope itself must be kept extremely cold. To protect the telescope from external sources of light and heat (like the Sun, Earth, and Moon) as well as from heat emitted by the observatory itself, Webb has a 5-layer, tennis court-sized sunshield that acts like a parasol providing shade. [Actual dimensions: 21.197 m x 14.162 m (69.5 ft x 46.5 ft)]
This sunshield will always be between the Sun/Earth/Moon and the telescope. It's able to be positioned this way because JWST will be orbiting the Sun 1.5 million kilometers away from (but approximately in line with) the Earth.
The sunshield will allow the telescope to cool down to a temperature below 50 Kelvin (-370°F, or -223°C) by passively radiating its heat into space. The near-infrared instruments (NIRCam, NIRSpec, FGS/NIRISS) will work at about 39 K (-389°F, -234°C) through a passive cooling system. The mid-infrared instrument (MIRI) will work at a temperature of 7 K (-447°F, -266°C), using a helium refrigerator, or cryocooler system.