Sodium nitrite

Sodium nitrite is a chemical compound. It contains sodium and nitrite ions. Its chemical formula is NaNO2.
Properties.
It is a white or yellowish crystalline compound. It is a strong oxidizing agent, being reduced to nitrogen. It is also a weak reducing agent, being oxidized to nitrate. It contains nitrogen in its +3 oxidation state. It is toxic in large amounts.
Occurrence.
It is found in some vegetables. It is also found in some meat in small amounts. Otherwise, it is manmade.
Uses.
It is used in meat like ham to preserve it. The nitrites are disinfecting, which helps preserve the meat. Almost all processed meat (like cold cuts, hot dogs) contains nitrites. Some people get headaches when they eat nitrites. These headaches have been named "hot dog headaches". It is used to make other chemicals and to get rid of sodium azide. It also can be used when someone is poisoned by cyanide. 
Safety.
Nitrites can form toxic chemicals when heated. These toxic chemicals are carcinogens, which means they can cause cancer. That is why some people do not want nitrites in foods. Others say that because nitrites kill bacteria, they should be included in foods. Sodium nitrite used in food is colored bright pink so it is not mistaken for salt or sugar.