Antibiotics are prescribed to treat certain bacterial infections. They do not work against viruses such as influenza. Although, in the case of influenza, you could get a secondary bacterial infection in which case, an antibiotic would be warranted.
There're several different classes of antibiotics and the one that's chosen is according to where the infection is in the body as well as any known resistance patterns in the community. That's something that the physician will know. They're usually prescribed in cold and flu season when somebody has an acute bacterial sinus infection or ear infection or known bacterial throat infection, or what we call pharyngitis, which is just a general term for inflammation of the throat.