POKE codes printed in ZX Spectrum magazines usually assume that you have a plug-in hardware device (such as Multiface). After loading the game, you can press the Multiface button to stop the game, enter POKE, and then return to the game.
Without a special device, you need to play with bootloader programs, as described in other answers. You need to load the small bootloader's initial program, and then BREAK into the code. If you're lucky, the code will do something simple with loading the rest of the game, and then perform a real game with computer code using the RANDOMIZE USR call. In this case, you can change the BASIC bootloader program to perform POKES after loading the game, but before the game starts.
However, many games make this harder because they include custom loader code. This is often written in machine code embedded in a small BASIC program in REM statements. Machine code will load the game and execute it, and since they never return control to the BASIC code, there is no way to enter POKE. If you are dedicated enough, you can try changing the machine code to return control to BASIC so you can BUY, or do POKE through machine code calls. This is quite complicated because, if I remember correctly, the editor used to scramble the lines containing non-printable characters in REM operations. There were software tools like RoyBot that could help you modify code in memory.
Some game developers did really crazy things to prevent the game from hacking, for example, injecting bootloader code that actually overwrote its own code during its execution.
source share