Here's how to determine it:
* Sodium (Na) is a Group 1 element, meaning it has a +1 charge as a cation (Na⁺).
* Cyanide (CN) is a polyatomic ion with a -1 charge (CN⁻).
Since the charges are equal and opposite, they balance out perfectly in a 1:1 ratio, resulting in the formula NaCN.