system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5 How does an anti-virus program know when something is a virus?

How does the whole process work?
gpt
How do you know when something is a dog? You have learned some features which are usual for a dog. Then if you see something that have these features you'll deduce that it's probably a dog. But sometimes you might be wrong and it's a coyote or a dingo or something. Or you come across some unusual breed and aren't quite sure if it's a dog or not.

Similarly an anti-virus program has a list of known viruses and what are the defining features of them. Then it scans files on your computer to see if your files have those features. If they do, then it might say that it's a virus. But sometimes it can be wrong and it's just something that looks like a virus, that's a false positive. Or if it's a very new virus then it might not be in the list of known viruses and it'll be missed.

As for removing a virus, the virus list also has information of what exactly the virus does and what needs to be done to remove it. So if the anti-virus program finds a virus in a file, then it does whatever the virus database has for instructions to remove it.