We assume that by “outside threats” you mean threats that attack your computer via a network interface. “Outside” can therefore mean the internet or other computers in your local area network. There are whole websites dedicated to answering this question, one of which is the German Federal Office for Information Security’s website BSI für Bürger. Here, we’ll just address a few of the key points.
Many attacks rely on a security gap in the software that your computer uses to process data from the network. Reputable manufacturers usually act quickly to close security gaps that they discover in their software. This is why it is important to always keep the software on your computer, your router and other devices up-to-date, as this minimises security vulnerabilities. A virus scanner can help to identify malicious data before it is processed by your computer.
However, even the latest software and virus scanners are not much help when you open the door to attacks yourself – by running files you have downloaded, for example. It is therefore advisable to only visit websites you trust and to be cautious when opening email attachments, even if they seem to come from a person or organisation you know, as it is easy to forge an email address. And yet, just as you cannot fully protect your home against intruders, there is no way to ensure that your computer is absolutely secure. You should therefore make regular back-ups of your data. If an attack on your computer is successful, a complete reinstallation might be the only way to fix the problem.
This question was answered by Florian Böhl from the research group Cryptography and IT Security at the Institute of Theoretical Informatics (ITI) at the Karlsruhe Institute of Technology.