As a mechanical engineer am here to share my department topic. "Whenever I started to study about how the engine works?". Books always replies with an answer "There are 4- stoke suction stroke, compression stroke, power stroke, and exhaustion".
So I started to google to get a complete configuration. I got a clear idea about it. There is the difference between explaining in text than visualizing.
In this image, you can see the two valve inlet valve and an outlet valve and in a middle, you can see the spark plug. For this stoke the piston moves from TDC - BDC which it creates a low pressure and makes the inlet valve to open the air-fuel mixture( In later topic we can discuss the air-fuel mixture ratio) is feed into the combustion chamber. The intake valve then closes and the air-fuel mixture is sealed inside the cylinder.
2.Compression stroke:
Compression is the process of reducing the charge from large volume to small volume. As the piston moves from BDC- TDC help to take compression. During this stroke, there is high pressure created due to the atomization of the fuel(petrol). This automized fuel mixture compressed to high as capable to fire itself without ignition that amount of compression created during this stoke. Reference
3. Power stroke:
After the piston reaches the TDC sometimes it may happen self-ignition sometime. Here the ignition starts from the spark plug. During overloading the self-ignition doesn't happen so this spark plug starts to spark and this sudden explosion creates a bulk power to rotate the piston. Thus the rotation of piston is transferred to crank. And hence the engine started to function. During this process, the piston moves from TDC - BDC. During this process the inlet valve and the outlet valve are closed.
The gas which is burned gases exit through the outlet valve, the flywheel helps to open the right valve at right time. The remaining unburned gases are also reused by filtering the unburned fuel from burned one,it is also a special process. The remaining burned gases are moved outside through muffler.