Creating cheat codes is not something most players can simply do on a whim. It generally requires access to specialized software, applications, and various development tools.
In practice, the most reliable path is to be a game designer yourself, since cheats are typically built into games by the people who make them. Without that kind of access or expertise, generating your own working cheat codes is difficult.