The purpose of the engine is to generate turning mechanical power (torque) from the chemical energy contained in the fuel.
In other words - the engine turns chemical fuel into mechanical torque
The energy in the fuel is released through combustion of the fuel mixed with air inside the cylinder where the expanding gases from the combustion force down the piston which turns the crankshaft.
The 2 basic designs of the internal combustion engine are;
4 stroke which uses valves to control the flow of the air / fuel mix
2 stroke which uses ports to control the flow of the air / fuel mix
The basic components of an engine are;
Sparkplug
Valves / Ports
Cylinder
Piston
Connecting Rod
Crankshaft