Press Enter during a game to open the chat bar, type the cheat, and press Enter again to submit it. That chat line doubles as the cheat console.
A well-known one is tuck tuck tuck, which spawns a large number of woodcutters. Others cover resources, units, and instant victory conditions, and most are variations on repeating a short word several times.
Two things to note. Cheats disable achievements for that session, so use them in games you do not intend to record. And they only work in single-player or unranked matches; entering one in a multiplayer game will simply post the text to chat.