Excellent words from my friends above. Follow their words and you can't go wrong. I have just a few more to add, on the conceptual level:
Script: A copy of a text used by a director or performer.
In this case, mentally replace "performer" with "program." A script is just a bunch of lines in a certain order which the program is to read, interpret, and perform. The lines should be in the performer's language, or the performer cannot perform them. For
Les Miserables, that's French. For
Rigoletto, Italian. For KoLmafia, we can use a couple different languages.
The first, and the one I recommend to get your feet wet, is CLI commands. These are commands which you can normally enter into the gCLI pane in mafia. Put a bunch of them together in a text file, one per line, and you have a script! (KoLmafia, like a good performer, will deliver the lines in the script in order.) There is a fairly comprehensive list of commands that can do most things you would normally do by lots of clicking. Definitely read the above links for more info about that.
The second is ASH, which is a more complicated language. In ASH, the performer (mafia) is easily thrown off if you don't use correct spelling, punctuation, and grammar. But you can do much more complicated routines with ASH, as some of the larger scripts around here demonstrate.
I'd recommend getting familiar with CLI commands first. Then, as the need presents itself (and if you start getting into it, the need
will present itself), you can start to venture into the bigger, more powerful world of ASH.
One other resource I would give you for a lot of great CLI command usage:
Hippymon's sidequest catalog. These scripts were very educational for me when I was beginning to write scripts for mafia.
Let us know how you fare!