In all honesty, there is no one way to know if your computer is safe. There are, however, many steps and precautions you can take to try and keep it as safe as possible. Below are a few of those steps.
1. Keep a password on your device: The first step I would say that could help you keep your computer safe is to have some type of safety lock on it. Most devices have preset locking types such as pins or passwords that you can use to keep your device secured, if you have your device open to anyone it becomes very easy to steal your information.
2. Use a VPN: A VPN (Virtual Private Network) takes your IP address and bounces it around to different servers so that nobody can know exactly where you are using your computer from. This is commonly used by hackers so they cant be tracked and can do their work without risk of being found and arrested. This is a helpful tool so that you can use your computer safely without anyone being able to find your location.
3. Install a Malware protection service: A malware protection service like McAfee will be able to instantly block most viruses and malware attacks before they have a chance to attack your computer. They usually cost around $150 a year and sometimes come with VPN plans included.
In conclusion, there is no true way to know if your computer is safe, attacks are sometimes undetectable or very hard to identify, but with the right precautions taken you can at least try and minimize the casualties.