The CPU reads each instruction in order line by line, storing and updating variables in memory and waiting for any needed input. It then sends commands to output devices like the screen, any errors/bugs stop the program running or make it behave unexpectedly.