When people talk about viruses and malware and worms, they might say something like “Won’t that mess up my computer?” In truth, viruses cannot damage the hardware directly. All a virus is is a piece of code that self-replicates to attack the data on your computer.
There is something of a gray area there, of course. There are instances where viruses can stop your hardware from working properly, but they can only do this by messing with your data. In other words, anyone who tosses a computer in the trash because viruses brought it to a halt is probably throwing money away.
If your hardware stops working after a nasty infection, you’re probably looking at malware that has attacked your driver software. By deleting or corrupting the software that, say, allows your keyboard to communicate with your motherboard, it may seem as if the virus has just broken your computer, but all you really need to do is eliminate the virus and then download the driver software again.
A virus could, in theory, damage the hardware by causing overheating, but this is hardly a concern with modern computers. Back when you only had about half a GB of storage space, a virus could stop your fans from working, for instance, and if you keep running your computer in that condition, then yes, overheating and eventual hardware damage may take place. This is hardly a concern for computer users in the 2010’s, though. Computers are considerably more durable today.
Any damage that a virus can do to your computer can be reversed with a fresh install. You might lose some data in the process, which is why regular backups and cloud based computing are always a good idea. Generally speaking, hardware damage is not a real concern when it comes to viruses. Viruses seek to mangle your data, not your hard drive.