If you are programming in BASIC, you use the SAVE command to save a file to a device.
Will write to a datasette (cassette recorder)
Will write to a datasette with a filename.
Will save it to the 1541 drive, assuming it is the primary disk drive. Replace with ,9 for the secondary disk drive (or ,10 or ,11 for the 3rd and 4th drives)