While planets reflect sunlight, they don't generate their own light like stars do. The Sun is a star, and it produces light through nuclear fusion, a process where hydrogen atoms combine to form helium, releasing massive amounts of energy in the form of light and heat.
It's important to remember that there might be planets orbiting other stars that are capable of producing their own light, but we haven't discovered any yet.