but why did kh need to be sealed, how are their heartless in kh,
It's actually explained in a different game, but since you want immediate answers...essentially, the KH in KH1 is not the real one. It's a smaller one that is only the "Heart of All Worlds" not the "Heart of All Hearts."
Since some worlds were plunged in darkness, it served as the source of the light for worlds that still existed, but the darkness for the worlds that had fallen to darkness. Sealing it broke that connection (otherwise, as opened it would have allowed the darkness to flow out) and the sealing allowed the worlds in darkness to return to light.
but if it was the source of light for worlds that still existed, how could any world be in light once kh jr was sealed ---