Don't certain processes decrease entropy? I don't really know much about entropy but I learned recently that the entropy in the universe is constantly increasing and that perhaps someday we will reach maximum entropy and the universe will end in heat death. In order for this to be true there are two prerequisites:


*

*Heat must constantly be created.

*There must be no way to destroy heat (at least no way that turns it into a more useful form of energy).


1 is certainly true. Every process creates some heat. When a person walks his/her feet hit the ground with kinetic energy and the friction creates heat. 
But I don't see how 2 can be true. For one thing, heat never even leaves its place of origin (earth, another planet or a star). In order for heat to travel in requires air (or some other conductor/convector). Since there is no air in space there is also no heat. Heat leaves things only in the form of electromagnetic radiation (light) (in the case of earth, infrared). 
So conversion from heat to light is certainly possible and is even found in nature. Now how do we get from light to other forms of energy? Well, photosynthesis. Solar panels. So this is possible too. If so, why will we ever run out of useful energy? Even if the rest of the universe does, can't we still reharness our own energy by converting the heat to light and light to other forms of energy?
Suppose the sun died (and leave aside the fact that it would first destroy earth with a supernova), can't we just put up a huge solar panel around earth to pick up all the infrared and convert it back to useful energy?
 A: The rule is that entropy must always increase globally.  This does not, however, preclude local decreases.  The most obvious example of this is a refrigerator.  Without any doubt, the heat inside the refrigerator goes down as it operates (and with it entropy goes down as well).  Locally, entropy is decreasing.  Globally, however, you must emit more heat (into the universe) than you remove from the fridge.  The room will always warm by a larger amount of energy than the fridge will cool.
As such, you can have processes like photosynthesis or devices like photovoltaic solar panels which generate usable energy (in the form of sugars or electric currents).  However, if you look at the whole scheme of things, you find that the sun had to waste more energy than your plant or solar cell could harness.  Our best solar cells are 46% efficient.  That means that when light from the sun hits them, only 46% of that energy is turned into usable energy, and 54% of it is lost.
You can see there is a way to have a perpetual motion machine here.  If you have a machine that is always 50% efficient, and you feed it with its own outputs(like you describe with the infra red solar cells), here's what happens.  Let's arbitrarily decide there's 1000J of energy to capture before the sun dies


*

*On the first round, you gather up 50% of the energy, and 50% is lost to heat.  This means you gathered 500J to do work with.

*On the second round, you gather up 50% of the energy, but there was only 500J to start with.  Thus, you harvest 250J

*On the third round, you can harvest 125J

*On the fourth, 62.5J

*On the fifth, 31.25J

*... and so forth... and that's assuming that you can recover 100% of the energy you spent doing work (which is also not possible)


You can indeed take this out to infinity.  Your machine can keep operating.  At some point, you're going to be operating on such small energy margins that some second-order effect will prevent you from getting your 50% efficiency and your machine will stop. But if you could build a machine that always got 50% efficiency, you could keep it going forever.  Not that it would do much good.
For a more rigorous analysis, I recommend reading up about Maxwell's Daemon.  For most of us, the operation of heat engines like this are confusing, and Maxwell's Daemon does a good job of capturing what happens when you try to cheat the laws of thermodynamics in a way which is accessible to mere humans.
A: Work requires a temperature gradient for a heat source and a heat dump. You can't get work out of a system no matter how much heat there is if there is nowhere for heat to go. That means that systems that eventually end up being a homogeneous heat mass, no more work could be extracted. 
