We often think that the sun rules the day and the moon rules the night. That's kind of right, but not totally.
The sun shines all the time. It shines during the day when we see it, and even at night when we don't.
As the earth turns, sometimes we face the sun. That's when we get day. When the earth's spin(自转)turns us away from the sun and we are in the earth's shadow. we get night. When people on the opposite side of the earth face the sun, those people have day while we have night.
Unlike the sun, the moon doesn't make its own light. Moonlight is actually the sun's light reflecting the moon back to us.
The sun lights up only the side of the moon that faces the sun. At the full moon, the moon is on the opposite side of the earth. Then the side of the moon facing the earth is all lit up. During the full moon, the moon rises around sunset, shines all night, and sets around sunrise.
Since the moonlight is so bright, you can sometimes see it during the day, too. A few days before the full moon, if you look east in the afternoon, you may see the moon in the sky. After the full moon, you may find it if you look west in the morning.
It is difficult to see the moon at the new moon, when its orbit(轨道)puts it between the earth and the sun. Then the side of the moon facing the earth is dark and we can't see the moon at all.