The easy answer is simply Jesus came down from Heaven to do the will of God, Jesus' and our Father. But, of course, it goes much further than that.
First, as in studying any independant verse, we must look at the passage for the context. Jesus was teaching that He is the bread of life. Jesus is illustrating that He is the true bread of God (John 6:33). Jesus was a gift to us from God.
Now Jesus said that if you saw Him, you have seen the Father. He also said He and His Father are one. That being known, it is important to recognize the fact that God the Father was with us in the flesh, also known as Jesus Christ. As impossible as that may seem to us, for we are mere humans and cannot always understand the ways of God, if we do not recognize that Jesus was God in the flesh, then we are denying much of the Bible concerning salvation. This is also why Jesus was recognized as "Immanuel" in Isaiah. "Immanuel" mean "God with us".
It is also important to know that Jesus came as a servant. Jesus came to serve His Father, God. That may seem confusing because, concerning this verse, it raises the question "If Jesus was God in the flesh, how could he have done the will of God and not of Himself, as illustrated in John 6:38?"
In the english language, the way this verse is worded makes it sound like the will of Jesus and the will of God are different, but that doesn't have to be so. The only difference is that the will of God was to give up Jesus as a sacrifice for our sins, and the will of Jesus was to serve His Father, God.
Easily documented, God is a spirit and outside of time itself. When God came down to Earth, He came in a way that bound Him to time and to a human body. God became a man for our sakes. Simply put, God became flesh. What is the will of humans, being a flesh creature? What is the will of flesh? To live. Jesus had to deny the will of the flesh and carry out the will of God to give Himself up as a sacrifice for our sins. Jesus denied the will of the flesh to carry out the will of the Spirit. Therefore, Jesus did not come down to Heaven to do His will, the will of the flesh, but to do the will of God, the will of the Spirit.
I hope this helps. If you have any questions, feel free to ask and I will do my best to answer them. God bless.