Isaac Azimov addressed that in The Last Question. It’s very short and worth reading.
Read it many times.......................
Asimov’s story is very interesting—no doubt.
But—it is based on extrapolation of our present knowledge—which will probably be laughably obsolete in a few hundred years.
One way to think about this is to take a look at the 1494 Treaty of Tordesillas—where the Kings of Spain and Portugal met with the Pope and divided the world in halves for their two empires.
They could never have imagined the world of today.
So it will be for current hairless apes—the universe is _not_ going to play by our “laws” or “rules”.
Larry Niven did a whole series of SF stories about this phenomenon. TO the point, a race of aliens called Puppeteers were running the galaxy for eons — sort of like how the Dutch ran circles around everybody in Europe when their trading empire was at its peak. Then, the Puppeteers hired some guy to go take a peak at the center of the galaxy in an experimental ship they developed. He came back with a report that, yes, the center was a black hole. Worse, it had consumed a bunch of stars, causing them to explode. The products of this was a wave of high-energy, fatal, sanitizing particles coming thisaway. That wave would arrive in 20k years. Oops. Puppeteers were notorious cowards. So, they dropped everything and scrammed for the next galaxy over. This collapsed the entire galactic economy for years.
There were about a dozen follow-on novels about this. Fascinating read if you are willing to suspend disbelief on a few things.