The reaction between sodium and oxygen can be represented by the following chemical equation:
$$4Na + O_2 → 2Na_2O$$
This reaction is exothermic, meaning that it releases heat. The heat released by the reaction can be sufficient to cause the sodium metal to melt and catch fire.
To prevent this from happening, sodium metal is usually stored in a mineral oil or kerosene bath. This prevents the sodium from coming into contact with air and reacting with oxygen.