How does the sun earth and moon system affect tides on earth?
Gravity from the Moon and Sun work to pull the Earth apart, creating bulges in the oceans on either side of the Earth, which are experienced as tides.
The Moon is the closest massive body to the Earth, and just as the Earth's gravity is strong enough to hold the Moon in orbit, the Moon's gravity is able to effect things here on Earth.
The Moon's gravity is enough to pull the water in the Earth's oceans slightly toward itself. Not enough to break orbit, just enough to cause them to bulge. This tidal effect causes the oceans to "pinch" around the middle and bulge on the near and far side of the Earth.
To understand why this happens, lets look at Newton's law of universal gravitation.
The Moon isn't the only massive object that effects the Earth, though. The Sun also influences tides, but on a smaller scale. Whenever the Sun and Moon are inline with the Earth, i.e. during a full or new moon, the tides will be at their most extreme, or spring tides.
During a quarter moon, when the Sun and Moon are not aligned, their tides will work to cancel each other out, and we have less dramatic tides, or neap tides.
Luckily, the tidal forces her on Earth only effect the oceans. Jupiter's moon Io is actually heated by tidal forces stretching the rock of the moon itself, and black holes form accretion disks where tidal forces shred anything that gets near enough.