A virus (from the Latin virus meaning toxin or poison) is a small infectious agent that can replicate only inside the cells of other organisms. All virus contain a set of genes which is either RNA(Ribonucleic acid) or DNA (Deoxyribonucleic acid), a protein coat called capsid protein that protects these genes. Some virus also contains a viral envelope around the whole capsid protein. Viruses vary from simple helical and icosahedral shapes, to more complex structures. Most viruses are about one hundred times smaller than an average bacterium.
The picture below will explain how the virus works.
Example shown below will be done on Influenza virus.