To activate the console where you input the cheat codes, you just press the ~ key at any time.
PC players get a chance to muck around with Fallout 4 before they even get down to the modding- the PC version of the game comes with exclusive support for all sorts of console commands and cheatcodes, that can either swing the tides in your favor, or break the game in hilarious ways (sometimes both).