Mark, themodynamics is fine for considering how a steam engine, or heat pump, or other relatively simple system that we can put boundaries around, works.
It is hopeless for considering how the nature of Earth works.
For that I would suggest you keep things simple, just tracing through where the Joules come from at source, and their effects on Earth.
It doesn't take long to reach and surpass how far conventional science appears to have gone with that, we start to see a picture of mathematically signed energy, all the way from source (That you mentioned we revolve around), to sink in all things on Earth, which conventional science appears to be convenieniently ignoring.
When nature uses it, we see creation, that is positive processes, using energy which constantly adds Joules to Earth.
When we use it, by exstacting energy from materials and stored fields of Earth, we are undoing what nature did, that is destruction.
A resonable measure of the effects of this destruction, is the effect on life, that is all species of life, including humans.
We have lost an awful lot of species of life, and their dying rate is accelerating.
If we are honest (Including our media), we shold be aware human dying rate is also at an all time high, we can't ignore that millions are dying.
The only way we can stop that is to do begin doing the same as nature does, that is make full use of the mathematically positive source of the sun, and work only with that.
Industry, and profit driven science, is doing everything it can to try to discredit this information, and you might believe it or not, but I can tell you I have been studying this thing voluntarily now for about six years since I first started to see the energy problem coming, when working on PhD candidate program, whilst still in a long career as a Systems Engineer.
The solution is community and domestic solar hydrogen.
With that, we can have a distributed power infrastructure which has drinking water circulation built in, requires no bulk batteres, in fact supersedes most batteries currently in use, and even gives us back leisure aerospace.
The reason it is not being pursued by those in real power, is that it means the end of capitalism, because capital is also superseded when we issue money on tha actual product adding to Earth, that is solar product. Money-as-debt only works for energy by extraction, not energy donated, which is the energy of the sun, it comes with no per-Joule labor of extraction, therefore can't be enummerated by money issued as debt, since that can only be redeemed by work, not energy received for free.
It helps to have formal Systems Engineering skills, tools, and experience, to be able to work these things out.
If you don't have those, I humbly suggest you might struggle to see the full picture, more or less documented now in around 300 stories I have done to date in Medium.
In case it does make sense to you, I have taken some time to respond to you here, in the hope that you might get onto the right trail.
If you are interested, my most recent significant story is the one below (Check out also the linked article in there on the "Missing Sign":