In The Empire Strikes Back, Luke Skywalker is directed by the ghost of Obi-Wan Kenobi, to seek Yoda on Dagobah. After training with Yoda, Skywalker leaves Dagobah early to rescue his friends Han Solo, Princess Leia, and Chewbacca, whom he senses are in danger on the planet Bespin.

Specifically, after having crash-landed in a swamp on Dagobah, Luke and Artoo find that they were marooned. They set up camp. They are surprised by Yoda, who doesn't immediately reveal his identity to Luke. But, Luke Skywalker is able to receive advanced training in the ways of the Force under Jedi Master Yoda on Dagobah, and later this becomes the place of Yoda's death and transformation into the Force.

More Info: en.wikipedia.org