How to Prevent Computer Problems from happening in the first place

Since the computer is used to many important works, it gives too much trouble everytime it malfunctions. There are different types of computer problem and it can be rooted to different causes. Some of these problems can be temporary and can be solved just by restarting the computer. Other problems can be fixed when the cause is solved. Just like runtime error which could occur if you have given a wrong input to the program. This could be solved by just providing the correct syntax that is required.