Planets reflect sunlight. Most planets are close enough to the sun that they can reflect its light and that is why you can see them. Some planets that are far from the sun do not light up because they have no light to reflect.
I hope this was a satisfying answer. Have a great night!