Chosen Solution
the computer suffers from blackouts without giving the order to shut down by invasion of cockroaches inside the computer.
Hi, What is the make and model number of the computer? It may be recoverable by thoroughly cleaning it with Isopropyl Alcohol 90%+, (available at most pharmacies - do not use “rubbing alcohol” as it is not as effective) All affected parts (including the PSU if it’s a desktop model) will need to be inspected and cleaned. Here’s a link that may be of some help. It applies to liquid damage but the cleaning principles are the same. As always with electronics, be gentle when handling and do not remove any components from the boards by being over vigorous when brushing away any contaminants etc. Electronics Water Damage
Ick! I think it is time for a new computer. Cockroaches are very unsanitary and getting them out will only lead you to find extensive damage to the electrical and other pieces of hardware inside the machine. Stop using this computer because if they did enough damage something can short and the computer can catch fire. Anyways, I think you are going to be looking at a new computer.