The chemical reactions and pathways involving cyanide, NC-, the anion of hydrocyanic acid. Cyanide is a potent inhibitor of respiration, reacting with the ferric form of cytochrome aa3 and thus blocking the electron transport chain.