There are several reasons why your computer can be slow. Especially when it happens suddenly, then it can be slow because of malware (spyware, adware, trojans, viruses..). However, it's not always malware causing this. A computer that suddenly becomes slow may have a virus or spyware program robbing its resources. You should run a virus scan and spyware sweep as a first step in diagnosing a suddenly slow computer.
Installing new software which may not be compatible with other software present already, a fragmented drive, uncontrolled applications, lack of maintenance, a full disk etc etc.. cause a serious system slowdown.
A lot of programs running in the background may cause a system slowdown as well, as they will steal away trace amounts of memory and processing time as your computer runs