How can one side of the earth be dark and the other side be sunnY?

Because one side faces the Sun and time changes as it turns.