You have to learn the conversational programming for the machine.
It consists of common "G" codes that tell the machine what to do.
I am familiar with Okuma but have not worked on Mazak/Fanuc.
Each controller has it's own quirks.
This link http://www.teskolaser.com/gcode_list.html
shows common codes used
Example
G00 - is a common code used to rapid the machine to a spot you tell it (G00 X2.00 Y2.00)
G01- is a Feed Rate for cutting
G73 is a common drill code
(G73 X2.0 Y2.0 Z-1.0 S1200 M3 M53 F6)
S- SPINDLE RPM
M3 - TURN ON SPINDLE
M53 - JUMP HEIGHT
F - FEED RATE
These are just a few to get you started.
There are also macros that you can program in complex operations.
The best way is to have someone show you how to program and then write your own and debug them.
My apprentices usually are writing programs from prints on their own in a matter of weeks.
Hope this helps a bit.