That's right! The moon doesn't produce its own light. We see it shining because the sun's light reflects off its surface.
Think of it like a mirror. The moon is a giant, rocky mirror reflecting the sunlight that hits it. That's why we see different phases of the moon, based on how much of the sunlit side is facing us.