How to clean a virus that we obtain in the internet

Why does other viruses that we obtained it can only be clean if we reformat the computer and re-install the OS(Operating System) and all the applications that we install in the computer in order to clean or to get rid the virus of the computer system?
