Learn a programming language such as Basic, C, Java, python, perl, etc. and write your program. If your language requires it, compile the program (I use gcc, or the GNU Compiler Collection, usually included on *nix, and available on Windows through MinGW/MSYS). If it's an interpreted language, there's no need for compilation. Then, make sure your program is executable (in *nix, set permisions to executable, in windows, it needs an extension like .exe), and run it.
In short, learn a language, write your program, compile, and run.