G-code is a language that 3D printers use to know how to build objects. It consists of commands that tell the printer where to move its head in three dimensions and when to push out plastic material. For example, a command like 'G1 X50 Y25.3 E22.4' moves the printer head to position X=50, Y=25.3 while extruding 22.4 units of material. The printer executes these commands step by step, moving and extruding to create each layer of the object. When the printer receives a command like 'G1 Z0.3', it moves the print head up to the next layer height. The extrusion amount increases as the printer lays down more plastic. This process continues until all commands are done and the object is fully printed.