why water is not used in car engines instead of petrol?
Because water does not combust or explode. Petrol is volatile when exposed to a spark which causes it to ignite, and if you place it into a cylinder under some pressure the gas will ignite and want to expand, which can be used to push on a piston, attached to a crank which can then produce torque. That torque is then used to spin some tires making the car move forward. Water will not react the same way that petrol does. When you expose water to a spark, it will not explode or combust.
However you can produce hydrogen fuels from water though! But that requires some electricity and some time and the amount of electricity that is required is not worth the amount of hydrogen you get as a result. But with petrol you can enrich it far cheaper and hydrogen production so we use it instead of hydrogen.