The following diagram shows how the moon causes tides on Earth: In this diagram, you can see that the moon's gravitational force pulls on water in the oceans so that there are "bulges" in the ocean on both sides of the planet. The moon pulls water toward it, and this causes the bulge toward the moon.
I attached the image related to your concerned question.
In theory, the part of the brain that is responsible for the sleep wake cycle is the hypothalamus; specifically, the ventrolateral preoptic nucleus of the hypothalamus. In the image, the location of the hypothalamus is pointed by the green square.