Assuming you're using Text Edit:
1) Make sure your file is plain text. Click Format at the top of your screen, and if you see something that says Make Plain Text then click that. If you see something that says Make Rich Text, you're already good.
2) File > Save > "whatever.cs"