The JWST works very much like any telescope in that its main job is to capture light and focus it so we can see further into the distance. There are a lot of differences though like JWST sees in a different part of the electromagnetic spectrum than our eyes do. We see visible light but JWST sees infrared or "heat", just like a night vision security camera. It's also really big so it can capture a lot more light and therefore see more distant, smaller, and colder objects. This is also helped by it being in space because it doesn't have to look through the atmosphere, which blocks a lot of really useful and interesting information.