Let's review the most common ways to create a CSV:
In a spreadsheet program, like Excel, Numbers or Google Sheets.
If you're working on data in tabular form, like a spreadsheet, you may wish to save as CSV (read about why programs use CSV here!). In this case, you don't need to do anything with the data itself. Instead, simply use the "Save as" and the ".CSV" option (just as you would if you want to save to ".XLS" or ".TXT" and so on). This will save your file in CSV format. Similarly, you can also use the "Export to" or "Download" and ".CSV" option to do the same, to save a copy of the file to your computer in CSV format.