Your first line of protection from viruses is a good anti-virus program. These can be purchased from any computer or software store, and are generally easy to install and configure. However, any anti-virus program is only as good as the last update. Most manufacturers offer free updates for a certain time period, which varies per program. The updates are available for download on the internet, frequently as often as once a week or once a month.
A second way to protect yourself is to refrain from downloading programs and other items from sites with which you are not familiar. And be careful when opening email attachments such as programs. Even when the program shows it is from someone you know, that person could unknowingly be infected.