programname >>my_output.txt 2>>my_errors.txt
This will run programname (replace that with name of the program you actually want to run) and append its standard output and standard error to the files my_output.txt and my_errors.txt (those filenames are arbitrary, you can call them whatever you want).
If you use > instead of >> it will overwrite the specified files each time you run it again, instead of appending to them if they already exist as >> does. In either case the files will be created if they do not exist.
You can read more about redirecting I/O in UNIX shells here.