The moon is visible on earth because the light from the sun falls on it, gets reflected from it and enters the eyes of the people who are watching it on earth. The moon appears crescent, half, full, not at all, etc, depending on its position with respect to the sun and the earth.
The light falling on any part of the moon gets reflected. However the light reflected only from some part of the moon reaches the earth. Only that part is visible to the people on the earth.
On the new moon day, the moon is on the same side of the earth as that of the sun with respect to earth. No light from the moon reaches the earth and it becomes invisible. Its apparent colour is black, i.e. same of that as that of the night sky.
On the full moon day, the moon is on the opposite side of the earth as that of the sun with respect to earth. The light reflected from the entire moon reaches the earth and it appears like a glowing circular disc.
Thus, on new moon day and a full moon day, earth, sun and moon are almost in one line.
For practical understanding, you can perform the experiment given below
Take a torch, switch it on and place it on a table.
Stand in front of the source of light of the torch.
Take a small ball and hold it at a height same as that of the torch and facing the torch.
You will notice that the ball appears dark.
Now if you change the position of the ball, keeping the height same, you will notice that only some part of the ball appears illuminated.
If you place it diametrically opposite to the torch, but at height slightly higher than your head, the entire ball gets illuminated.
You can also notice that in the positions where the ball appears completely bright and in that when completely dark, the torch, your eyes and the ball are in one line.
The phases of the moon are due to situations similar to this experiment.