There are various reason on how your computer might get a virus or get hacked
1. Operating system that you are using on your computer
2. If you have ever installed security patches for your computer
3. Any Unknown website that you visit
4. Openning emails from unknown senders
5. connecting other devices that can tranfer data to your computer ( for example if you use an USB stick
which is already infected by virus)
6. downloading softwares from torrents
7. installing pirated games or softwares
so it is always advised that you a good anti-virus installed on your computer.
