Most cheat codes for older PC games end up on long-running fan sites and wikis, which are far safer than random download portals. Search the exact game name plus "cheats" and stick to pages that show the codes as plain text.
Be cautious with anything that arrives as an installer or a "trainer" file — that's the most common way bundled malware sneaks onto a machine.