There's many ways to explain what happened in the movie, so I will leave that to a quote form E.T. Wikipedia article :
On Halloween, Michael and Elliott dress E.T. as a ghost so they can sneak him out of the house. Elliott and E.T. ride a bicycle to the forest, where E.T. makes a successful call home. The next morning, Elliott wakes up to find E.T. gone, and returns home to his distressed family. Michael finds E.T. dying in the forest, and takes him to Elliott, who is also dying. Mary becomes frightened when she discovers her son's illness and the dying alien, before government agents invade the house.
Scientists set up a medical facility in the house, quarantining Elliott and E.T. Their link disappears, and E.T. then appears to die while Elliott recovers. A grief-stricken Elliott is left alone with the motionless alien when he notices a dead flower, the plant E.T. had previously revived, coming back to life. E.T. reanimates and reveals that his people are returning.
I never fully understood why do they became sick and how do they recover?