I always beat the game first, but afterwards I goof off and have fun with cheats and mods. Sometimes (in the case of some mods that make the main story more interesting, for example) I might restart the game, and for others (GTA) I'll go crazy with post-game cheating.
I have never, however, cheated because I couldn't beat a game. If I couldn't beat a game, no matter what I tried, I would look up where I screwed up. I might restart. I might leave it for a month, then restart. But I wouldn't cheat because I couldn't beat it.