Different medicines do different jobs
Antibiotics kill bacteria or stop them growing. They do not kill viruses. Painkillers relieve symptoms such as pain; they do not kill the pathogen causing an infection.
The correct antibiotic must be chosen for the bacterial infection.