An antibiotic is given for the treatment of an infection caused by bacteria. Antibiotics target microorganisms such as bacteria, fungi and parasites. However, they are not effective against viruses. If you have an infection it is important to know whether it is caused by bacteria or a virus.Most upper respiratory tract infections, such as the common cold and sore throats are generally caused by viruses-antibiotics do not work against these viruses.lthough there are a number of different types of antibiotic they all work in one of two ways: 1  A bactericidal antibiotic kills the bacteria. 2  Penicillin is a bactericidal. 3  A bactericidal usually either interferes with the formation of the bacterium's cell wall or its cell contents.