This world does not literally end, only figuratively. When we learn to live forever, we go and explore the universe. Of course, before we can do that, we have to change our system of things, our "world." The old "world" will be destroyed and we will have a new one.
Ten thousand years from now we will have the technology to fix the Earth or the Sun if they need it, so they don't have to end.
I have faith that with God's help we can do it.