Before the manned Apollo missions could take men to the moon and back, unmanned tests were needed to ensure all of the hardware and systems worked properly. That's where missions like Apollo 6 came in.
Apollo 6 took off aboard a Saturn V rocket on April 4th, 1968. It was originally planned to take an unmanned Apollo craft to the moon.
However, technical difficulties with the upper stage prevented this.
Instead, those behind the mission decided to test the spacecraft in a high Earth orbit and to test the re-entry capabilities of the command module. That module landed safely in the Pacific Ocean.
Despite the issues with parts of the mission, this shakedown cruise was considered successful enough that the next missions would be manned.