Global warming - why doesn´t mankind collect heat (thermal energy) and turn it into electricity or send it to space?
Your middle school physics perhaps hasn't gotten to thermodynamics yet. The three laws of which can be summarized as 1) You can't win; 2) You can't even break even; 3) You can't leave the game.

The crucial point here is that heat engines don't actually work on heat, they work on temperature differences.  So you can't really "collect" heat and turn it into other forms of energy, because you need a colder place to transfer the heat to in order to convert the heat to say electricity.  Which is why power plants are usually situated by oceans, lakes, or rivers, in order to use the water as the cold side of the generator.  (And ones that aren't have large cooling towers, in order to use the air.)

When you do move heat around, say with the heat pumps used for home heating and cooling, you're always using some extra energy to "pump" the heat from one place or another.  If you're heating, you move some heat from the ground outside to your house, but the net result is that the system of ground+house gets a bit warmer, because the electricity used for the pump becomes heat.

WRT sending the heat back into space, that's actually the cause of global warming.  Atmospheric CO2 acts as an insulating blanket, preventing some of the sun's heat from being radiated back out into space.  By increasing the amount of CO2 in the atmosphere, we've increased the thickness of the blanket, so the Earth gets warmer.