2009 Hyundai i20 engine died while driving and it is now not cranking. I have changed spark plugs but in vain
My bet is, your battery is too dead to run the engine, which could be caused from a bad alternator. You can check the voltage at the battery using a digital multimeter (DMM). It should be around 12.5vdc or better. If it is less than this, try charging it and seeing if that allows you to start and run the engine. If it doesn't take a charge, then you'll need to replace the battery. If it will take a charge, you need to test the voltage while the engine is running. It should be between 13.5-14.2vdc (or there about). If the voltage is still at battery voltage while running, your alternator is bad.
Check the starter motor is it well attached to the bell housing i once experienced the same problem but on a Mercedes Benz and later found out i had loose starter bolts.
If it bolted nice and tight then the problem might be within the starter motor maybe a faulty starter solenoid . Then check all the wiring harness