A file is a collection of related data stored as a single unit with a name to identify it. Computers store files in secondary storage so their contents remain intact when the computer shuts down. To process a file, a program must open the file, read or write data to it using functions like fopen(), fread(), fwrite(), and fclose(). Common file operations in programming languages include opening, reading, writing, and closing files.