Open the cheat window with Ctrl+Alt+Shift+C, then type a code while the game is running.
Pausing before you type is worth doing. The cheat window accepts input while the simulation runs, and a city left unattended for the time it takes to type a long code can develop problems you then have to fix.
They unlock buildings and add money; they do not fix bad city design. A city with no road hierarchy, mismatched zoning density or an underfunded grid will still fail regardless of how many rewards you have available. The cheats remove resource constraints, which makes design mistakes more visible rather than less.