Hi,
when I started, I wrote some very very simple Gcode by hand. Its extremely useful to look at some Gcode and get a picture in your mind as to what toolpath is being
described. There will be times even when you have Gcode written for you or composed with a CAM program but does not operate quite as you thought it might,
and that's when you might want to look at the code to see if there is an extraneous or mal-performing instruction.

As others have pointed out various programs like Mach3 allow you to write and simulate Gcode. There are others programs known as Gcode viewers and simulators
which are also useful. I found within a few days I had the basics in hand, and I've just gotten better at it over the ten plus years since.

I am not a machinist by any stretch of the imagination, but my Uncle showed me how to use a lathe when I was 8 or 9 years old, and used a mill when I got to University (in the student
workshop). I got some early experience in CNC, again in University, when I begged and pleaded with the technicians in the Engineering school workshop that I was fairly basically capable.
Still had to bribe them with dozens of beers, but I did get some use of an early CNC Bridgeport.

The truth is the people who make the best CNC machinists usually those whom started out as good to bloody good manual machinists. Gcode and all of that is like another layer on top.

Craig