Imagine a large office mailroom where all incoming mail arrives. Each piece of mail has a specific envelope color and label that tells the mailroom staff where to send it. For example, blue envelopes go to accounting, red envelopes go to marketing, and green envelopes go to human resources. The mailroom staff know exactly which department to deliver each envelope to based on its color and label.
In computers, files are like these envelopes. Each file has a type, shown by its extension (like .docx, .jpg, or .mp3), which tells the computer what kind of content it holds. The computer uses this information to decide which program should open the file, just like the mailroom uses the envelope color to decide where to send the mail.