Do you mean how I identified the UI elements (windows, buttons, etc.)?
Personally I’m using mainly Script Debugger and Accessibility Inspector, sometimes helper scripts like this or that. Many people use also UI Browser.
(Of course, instead of Script Debugger it’s also possible with Apple’s Script Editor, but quite less comfortable.)
See also these two great posts by @ccstone: One, two
Or search the forum for “ui scripting”.
But keep in mind that AppleScript UI scripting should always be the second-to-last resort, when regular AppleScript (or JavaScript) fails, for example if the target app is not “scriptable”. (The last resort would be UI scripting via KM, e.g. simulating Tab keys or searching for images and simulating clicks on them.)