The JWST orbits around a point in space called the L2 Lagrange point. This is 1.5 million km away from us so that the heat from Earth doesn't get in the way of what it's looking at. L2 is a gravity well so we can use less fuel to keep it there than if it was just floating at a random point in space. It is also useful that L2 follows us around the sun, so we are always able to communicate and download images from the telescope.