KSH redirect stdout and stderr to a file on Linux or Unix

Originally published at: https://www.cyberciti.biz/faq/ksh-redirect-stdout-and-stderr-to-a-file-on-linux-or-unix/

I am working with KSH script on Unix operating system. How do I redirect error messages in Unix when using KSH? How can I redirect stdout and stderr with KSH on Linux or Unix-like systems?