The sun will exist for hundreds of thousands of years after humanity has gone extinct. The sun will exist for millions of years before it burns out. Humanity will thrive diminish and die before the sun dies.
It is by all intents and purposes an infinite resource for a finite species.