Try this: Turn on the stovetop in your kitchen, and hold your hand over a burner but don’t touch it. As the element warms up, it produces infrared light. You can't see this light, but when it hits your hand, you can feel it as heat.
Although you can't see this kind of light, an infrared camera can. Check out this infrared image of me pouring a hot cup of coffee:
This is a false-color image. Basically, the camera mapped colors—from yellow to purple—onto different wavelengths of infrared light. The brighter yellow parts (like the pot of coffee) represent hotter things, and the darker purple parts are colder. Of course, reality is more complicated than this (you can also have reflected infrared light), but you get the idea.
Great. But why does the JWST look at infrared light? The reason is the Doppler effect.
You already know about the Doppler effect. You can hear it when a train or car moves past you at a high speed: The sound changes frequency because the source is first moving toward you, and then later away from you. The vehicle’s sound has a shorter wavelength, and therefore a higher pitch, while coming toward you, and then a longer wavelength and a lower pitch when it is moving away. (Here's an older post with more details).)
It just so happens that you can also get a Doppler effect with light—but since the speed of light is super fast (3 x 108m/s), the effect isn't noticeable in many situations. However, because of the expansion of the universe, just about all of the galaxies that we see from Earth are moving away from us. So to us, their light appears to have a longer wavelength. We call this a redshift, meaning the wavelengths are more red because they are longer. For very distant objects, this red shift is so large that the interesting stuff is in the infrared spectrum.