James Webb Space Telescope captures the first phase of star formation in distant galaxies