Jesus promised that his followers would be with him in heaven. They had followed him on earth every day for several years. But then he told them he was going somewhere they could not follow. He was telling them he would die and go back to the Father in Heaven. They were troubled by this, because they did not want to give up their daily fellowship with him.
Jesus told them not to be troubled, but to believe in him. (John 14:1) Specifically, he wanted them to believe they would be reunited in heaven. He said "I go and prepare a place for you. And if I go and prepare a place for you, I will come again and take you to myself, that where I am you maybe also." (14:1-2)
The words "come again" lead some to think this is about the second coming. But the context is clearly Jesus going to join the Father in heaven and the disciples following later. That is why Jesus said "no one comes to the Father except through me". (14:6) The Father is in heaven. Jesus joined him there. If we want to be in heaven, with the Father, we must do it "through the Son". Belief in Jesus as the Son of God allows us into Heaven.
The words of Jesus are comforting. He said "I will come again and take you to myself". When we die, Jesus will come for us and bring us to heaven to dwell with him and our heavenly father. Death for the believer is not a deep sleep, or an abode in darkness or pain, but the moment we are ushered into the presence of our savior and lord. Take comfort in this. "Let not your hearts be troubled" by death.