I was told the following

If the fire is relatively small, and you have a large extinguisher, then open the hood just sufficiently to use the extinguisher. DO NOT fully open the hood until the fire appears to be out, and even then have a second unused large extinguisher to hand when eventually fully opening the hood.
Dry powder is considered the most effective type of extinguisher for vehicle fires but is also the most destructive. CO2 is fairly effective but disperses very quickly in the open air. Foam is effective.

If no large extinguisher is to hand, leave well alone and await the fire brigade.

If a vehicle is well alight then it is already a write off, but in most cases the fire should still be fought least it spreads to structures or other vehicles.
Perhaps surprisingly, water from a hose may be used on a vehicle fire, it is mainly rubber and plastic burning and not petrol.
Apply the water such as to cool surfaces and prevent the fire spreading.