G-code is a language for communicating with machines. G-code is a rather simple language, that can be edited with a text editor like Notepad or TextEdit.
The G-code determines a machine’s movement, but also parameters such as spindle speed, depending on the CNC; Or may control temperature depending on the machine. (G-code is also used for 3D Printers!)
Early machines would take input from punch cards that would look like this:
Fortunately, these days Computer Aided Manufacturing (CAM) software generates G-Code for us. Using V-Carve Pro, SolidCAM or Fusion360, you can easily set up jobs for your CNC Router, then send and carry out the job without needing to write any G-Code.
Therefore, an understanding of G-Code is absolutely NOT necessary, but it may be of interest.
There are many, many types of individual G-Code operations, as you can see here. We recommend using the examples like those on NCViewer.com. NCViewer.com is a G-code simulator that interprets G-code for you, even as you edit it. Link to its online simulator: https://ncviewer.com.
Play around a little to understand how CNC machines “think”. Try writing a G-Code sequence that draws:
View in the NCViewer application above to check your result!