Understanding heat engines and its relationship with the second law of thermodynamics I am having trouble with understanding the so called Second Law of thermodynamics.
There are a million different definitions. All of them get to the essence: 

"Disorder increases, stuff gets wild and wilder".

Thermodynamics starts out of the curiosity: "Why can my engine not be more efficient?"


*

*Heat and Work are Internal Energy that's being transferred (from and to the stuff that's being analyzed).

*A heat engine wants to transform heat flow into work flow.   


It will work considering that a gas under high pressure and high temperature (state 1)* wants to increase its volume (because it wants to be comfortable in a bigger playground).
So:


*

*High pressured gas wants to expand [with heat source - stays warm] (positive work flow coming from a loss of its internal energy, but internal energy stays constant while gaining heat flow)

*High pressured gas wants to expand [no heat source - loses internal energy] (generating positive work flow)


Now the gas doesn't want to expand anymore. It's chilling. Balance.
Everything would stop here naturally.
But we want it to work again.
We force compression to take all the stuff back, so everything can restart.
(Question 1) Where does the energy required for the compression come from?
Anyways, the gas compresses, and gets hot because it feels uncomfortable again. But nah, we put something colder around so its increased Internal Energy stays constant (because it will run away as a heat release to the colder place).
And then at a certain point we take away the Cold thing, just so the gas cannot do anything else than keep its increasing internal energy (which comes from uncomfortability).
(Question 2) Why would we divide the compression into two steps? Why can the gas not just be compressed and increase its internal energy so we have more temperature at the (state 1)* to restart all the stuff with more "strength"? What's the point of releasing that internal energy it is gaining from the compression we are forcing?
(Question 3) What's the real beginning of the 2nd law? Where does it come from and how does it apply here, in the engine?
 A: It seems you are describing the thermodynamic cycle in a Carnot engine consisting of isentropic and isothermal steps.

(Question 1) Where does the energy required for the compression come from?

This is supplied externally. After completing the cycle, the Carnot engine produces net work, but some work is needed to keep it going in some parts of the cycle. This can be done e.g. by using a motor with flywheel. The flywheel temporarily stores excess kinetic energy that can be used to overcome the negative work parts of the cycle. 

(Question 2) Why would we divide the compression into two steps? Why can the gas not just be compressed and increase its internal energy so we have more temperature at the (state 1)* to restart all the stuff with more "strength"? What's the point of releasing that internal energy it is gaining from the compression we are forcing?

This question can be answered in several ways, and it depends on personal taste whether you will like mine. First of all, it should be clear that we can't just reverse the previous steps in the process, or there will be no net result. Another crucial element is the fact that compressing some volume takes less work at a lower temperature than at higher temperature. This is why compressors have cooling fins and industrial processes often have intermediate cooling steps (intercoolers). By expanding a hot gas, and compressing it again at a lower temperature, we can realize net positive work.

(Question 3) What's the real beginning of the 2nd law? Where does it come from and how does it apply here, in the engine?

I would recommend looking at the historic developments in the field. As you mention, there are several formulations of the second law. Some are more generally applicable than others, or are more quantitative of nature than qualitative. 
The second law is relevant for the Carnot engine, because the thermodynamic cycle is limited to operate between the temperature bounds, because it is impossible to transfer heat from low to high temperature. The formulation of the second law which is most applicable to the heat engine is this: no thermodynamic cycle producing net work can exist which has as only effect the cooling of a single heat reservoir. From this follows that rejecting some heat in a lower temperature heat reservoir is required to produce work. Furthermore, the reversible Carnot cycle is one without entropy generation, from which follows it has maximal efficiency.
Additional clarification
OP had some more questions in comments to the answer.

Can the work with the flywheel not be used to compress the gas just as it is, without letting it flow out heat? 

If the machine and flywheel are perfectly reversible, then yes the flywheel could compress the gas again. But, this would just follow the process path that was taken to produce the work in the opposite direction. In other words, this goes back to where we came from. It's theoretically doable, but doesn't lead to a power-generating machine.

... the thing is that it will involve less work to compress the gas in a low temperature and that's why. In that case heat flowing to low temperature was not the purpose, but the inevitable consequence. 

Indeed. 
