The day and night occurs because
the Earth rotates itself along its axis
The earth revolves around the sun and rotates around its own axis. The rotation of the earth causes day and night. The part of the earth which faces the sun experiences the daytime whereas the part away from the sun gets no sunlight and hence the night. The axis of the earth's rotation is tilted at 23.5 degrees.