When the moon is not visible at night, it is still present in the sky, but its position in relation to the Earth and the Sun makes it appear invisible. The moon goes through a lunar phase cycle, which is why its visibility changes throughout the month.
During the New Moon phase, the moon is located between the Earth and the Sun. From Earth, we see the side of the moon that is not illuminated by the Sun, so it appears dark and invisible in the night sky. However, it is still there, just not visible to us.
As the moon orbits around the Earth, it goes through different phases, such as Waxing Crescent, First Quarter, Waxing Gibbous, Full Moon, Waning Gibbous, Third Quarter, and Waning Crescent. The visibility of the moon depends on the angle between the Sun, Earth, and the moon.
So, when the moon is not visible at night, it is generally positioned close to the Sun in the sky, and its unilluminated side faces the Earth.