why sodium metal or potassium metal are kept in petrol, etc, why not in water i know that? i know that oxygen is supporter of combustion and hydrogen is highly flammable but petrol also contains hydrogen.
Sodium reacts with oxygen, so it has to be kept away from air. Storing it under a liquid is an easy way to do that. Water is our usual go-to liquid, but sodium reacts with water (and also floats on top, because it’s less dense than water), so water is not a good choice. Sodium also reacts with alcohols, so those are no good. It does not react with hydrocarbons, and is denser than all the ones I can think of, so they are a good choice. Kerosene is cheap, pretty non-toxic, does not evaporate as fast as some hydrocarbons, and so is a pretty good choice.
However, for long-term storage, mineral oil is preferred, since kerosene will evaporate eventually if the container is not perfectly sealed.