Answer:
With an immune response.
When particles of a virus enter our body and are identified by the immune system as foreign "invaders", our bodies use the invaders, which are also called antigens/antibody generators, as a template to create matching antibodies. Antibodies (also called immunoglobulins) are sort of like a lock and key system that, when matched perfectly with the antigens, can "lock" or neutralize the antigens so they can no longer enter or damage our cells. To neutralize each different strain of organism, the antibodies must have the right pattern to match the characteristics of each antigen. A match will allow the antibodies and immune response to make a "lock" to fit those viruses. Our body remembers each new virus pattern that has caused an immune response in the past (either from getting an infection or from vaccinations), so that it can make those matching cells to protect us from that same specific flu strain (or strains that are very similar) in case it ever enters the body again in the future.
Our body has the ability to determine when a virus has invaded and, if it has a match to that strain of virus stored from a prior invasion, the immune response is generated and the immune system quickly makes up a lot of those attack cells (antibodies), that the body made and that worked in the past to destroy/neutralize the invading virus particles. If it is a new invading virus, usually our body can make cells that can match just right in a week to ten days. (It can sometimes do this even more quickly for bacteria and other microbes.)
It is during this time period, when our body is matching and making the attack cells to "kill" the invader, that we feel sick until our body finds the key pattern of cells that will match and lock that specific virus. Our immune system wastes no time in locking up the invading organism, because it knows already what antibodies will work. That is why, once we have had a flu virus like Swine Flu before, we won't get sick from it again. Our body will already know what cells to make and will send them out to destroy the invader even before it can make us feel sick.