As a kid I thought we would all get taken out when the sun goes red giant, but the other day I learned that life on earth will die out long before that. Once the mid ocean ridges are above water, water will no longer get subducted into the mantle, putting an end to plate tectonics which depends on water for lubrication, and the atmosphere will be wiped out by solar wind.
I've been told sea water has been decreasing for the past 600 million years as it has been transported into the mantle in the form of hydrous minerals. Eventually mid ocean ridges will form summits above the declining sea water, and the remaining sea water will not be able to climb the slopes of the mid ocean ridges to enter the mantle as hydrous minerals anymore. If water cannot be taken into the crust as a lubricant, the process of plate tectonics will come to an end. Volcanic activity along subduction zones will stop, new mountains will no longer form, the existing mountains will wither away from erosion, and other severe environmental changes will come from erosion as well. Subducted cold plates will not go down to the bottom of the mantle. The outer core will not be cooled down anymore and the geomagnetic field will disappear. Earth's atmosphere as a result will be removed by the solar wind, and all multicellular life will go extinct. Earth will become a Venus-like planet. The oceans will disappear and eventually even extremophile single-celled organisms will no longer be able to survive.
That's one version of events. There are many competing hypotheses about the future geological outcomes of the Earth. To be fair I think the continued influence of humans makes it all very hard to predict, and it could end much sooner or much later depending on what humans do and how powerful they become.