Learn about this topic in these articles:

entropy

It is possible, however, that in the course of time the universe will suffer “
heat death,” having attained a condition of maximum entropy, after which tiny fluctuations are all that will happen. If so, these will be reversible, like the graph of Figure 13, and will give no indication of a direction of time. Yet, because this undifferentiated cosmic soup will be devoid of structures...

The example of a heat engine illustrates one of the many ways in which the second law of thermodynamics can be applied. One way to generalize the example is to consider the heat engine and its heat reservoir as parts of an isolated (or closed) system—i.e., one that does not exchange heat or work with its surroundings. For example, the heat engine and reservoir could be encased in a rigid...

thermodynamics

...and none of the state’s energy may be usefully employed. When applied to the universe as a whole, considered as an isolated system, this ultimate chaotic condition has been called the “
heat death.”