What’s the safest process to fix viruses in the computer?

I have this hypothesis that my computer was attacked by a computer virus because my computer suddenly freezes. Now, I would like to ask which is the safest thing to do; run a disk fragment, use virus scan, or just scan the disk. Are these processes will really solve my computer problem? If they all worked, what should come first?
