Have a look in the preview window (if using axis)
You will see that there is a dotted red box that shows the machine limits, and the toolpath will be inside that box. Or should be at least.
You should also see the current G-code origin and the current position of your tool inside the work envelope.
If you press the "touch off" button and set X Y Z to zero you will see the path preview move, and see the G-code origin move to be at your tool-tip.
You can set X Y Z to values other than zero, too. Try it, attempt to get a feel for what this does, and how it moves the tool path around inside the machine envelope.
Typical G-code has an origin at some base part feature or at the corner or middle of the starting material. The g-code origin is _never_ at the upper front left corner of the work envelope where the machine absolute origin is.
Once the tool path preview lies entirely inside the machine envelope box, the code will run.
This will all make a great deal more sense when you start making actual parts.