Hackers create programs that do collection of information about a computer connected to internet. They create virus a program that copies itself on to files on a computer and spreads whenever that program or file is used. The virus files can find and exploit weaknesses in the computer configuration. These can use administrator authority or one user's authority and perform unintended actions.
These programs could shutdown system, display unintended messages, corrupt important data, waste time of users etc.
It is important to use anti virus software and regularly update signature files. Do not visit any website just like that, without knowing about it. Use firewall on your computer to protect it.