Unfortunately, there's no guaranteed way to prevent error code 36. The best you can do is take care of your storage devices and keep your operating system updated.