In this section of Scripture Paul is saying that the Christians who have died are with the Lord, so we should not be sad like the world and their bodies will rise first from the grave at the coming of the Lord. He says the dead in Christ will rise first then the believers who live will rise to meet Christ in the air. The encouragement is that the dead and living believers will be reunited to share glory in His presence when He returns. This ought to comfort us that we will be resurrected and have this hope that our bodies will be transformed before we die. For those who are raptured (be caught up to heaven before we die), this also means we will not go through the Tribulation. This is why Paul is comforting the Thessalonians.
1 Thessalonians 4:13-18 But I do not want you to be ignorant, brethren, concerning those who have fallen asleep, lest you sorrow as others who have no hope. 14 For if we believe that Jesus died and rose again, even so God will bring with Him those who sleep in Jesus. 15 For this we say to you by the word of the Lord, that we who are alive and remain until the coming of the Lord will by no means precede those who are asleep. 16 For the Lord Himself will descend from heaven with a shout, with the voice of an archangel, and with the trumpet of God. And the dead in Christ will rise first. 17 Then we who are alive and remain shall be caught up together with them in the clouds to meet the Lord in the air. And thus we shall always be with the Lord. 18 Therefore comfort one another with these words.