By “the world” do you mean the earth? Or humanity? We think that the sun will die out in about 5 billion years, and this means that the earth will die with it too. If we are right about that, and the earth is still inhabitable by humans then, then the earth will be absorbed by the sun too because it will no longer be able to orbit it. The only way for humans to survive that would be to find somewhere else in the universe to live! But this is a very long time from now, 5 000 000 000 years! This is way longer than the age of humanity itself!
As a scientist (;]), I think that is is more likely that the earth will become uninhabitable before that time. This could be because we do not take care of our environment very well and we are running out of resources and harming the earth in such a way that it cannot sustain us anymore.