In general, the above wrote is true. You may receive this error message in many different cases, and it may not be related to Office at all, but rather to your OP system. And it (Windows itself) can be damaged, it can be unmaintained and uncleaned, it can be out of date for a long time, and there may be a million more bugs in it. Even this is the case if you have disabled Windows Defender and installed something else instead. But if the reason is Office itself, then,...as for Office, this is usually because the previous version or the same or some other version of Office has not been properly removed and you are trying to reinstall what ever version, no matter which one. Keep in mind that you should use a special tool to remove any version of Office. Any regular or third-party uninstaller may cause similar problems.
You should use the Microsoft Support and Recovery Assistant. Search for it and use this.