A computer virus is a self-replicating malware that modifies other software. Damages caused include affecting files and consuming device's resources. Viruses disguised themselves in other software image or document.
To propagate, they rely on user activities like downloading software, plugging a pen drive or inserting a CD.
For protection against viruses, use a good full-featured antivirus software - not just the free basic version. But remember, viruses keep evolving and no antivirus can protect you 100%.
Moreover, download files only from the sources you trust, never use a pen drive or CD you found somewhere.